From fdc860c71b3c91baed005a2849b43f3f48d7357b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 6 Jul 2023 13:51:37 +0200 Subject: [PATCH] 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. --- src/modules/module-protocol-native.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/module-protocol-native.c b/src/modules/module-protocol-native.c index 48f81e9a3..e2dff43f4 100644 --- a/src/modules/module-protocol-native.c +++ b/src/modules/module-protocol-native.c @@ -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)