module: fix registration of modules

Don't fail when protocol-native is already registered.
This commit is contained in:
Wim Taymans 2017-07-19 12:44:10 +02:00
parent 91d54364fc
commit 589e3d977c
10 changed files with 50 additions and 36 deletions

View file

@ -715,6 +715,9 @@ static bool module_init(struct pw_module *module, struct pw_properties *properti
const char *val;
struct protocol_data *d;
if (pw_core_find_protocol(core, PW_TYPE_PROTOCOL__Native) != NULL)
return true;
this = pw_protocol_new(core, PW_TYPE_PROTOCOL__Native, sizeof(struct protocol_data));
if (this == NULL)
return false;