mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
protocol-native: give an error when loading twice
Instead of silently ignoring the problem. It's possible that it is loaded with different settings, which would then silently be ignored.
This commit is contained in:
parent
48a892aeec
commit
fdc860c71b
1 changed files with 4 additions and 2 deletions
|
|
@ -1472,8 +1472,10 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
|||
PW_LOG_TOPIC_INIT(mod_topic);
|
||||
PW_LOG_TOPIC_INIT(mod_topic_connection);
|
||||
|
||||
if (pw_context_find_protocol(context, PW_TYPE_INFO_PROTOCOL_Native) != NULL)
|
||||
return 0;
|
||||
if (pw_context_find_protocol(context, PW_TYPE_INFO_PROTOCOL_Native) != NULL) {
|
||||
pw_log_error("protocol %s is already loaded", PW_TYPE_INFO_PROTOCOL_Native);
|
||||
return -EEXIST;
|
||||
}
|
||||
|
||||
this = pw_protocol_new(context, PW_TYPE_INFO_PROTOCOL_Native, sizeof(struct protocol_data));
|
||||
if (this == NULL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue