module-raop: fix warning on uninitialised res variable

This commit is contained in:
Wim Taymans 2023-05-01 09:59:55 +02:00
parent 0bb0b524c7
commit c23c27b566

View file

@ -1902,10 +1902,13 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
impl->context = context; impl->context = context;
impl->loop = pw_context_get_main_loop(context); impl->loop = pw_context_get_main_loop(context);
if ((ip = pw_properties_get(props, "raop.ip")) == NULL) ip = pw_properties_get(props, "raop.ip");
goto error; port = pw_properties_get(props, "raop.port");
if ((port = pw_properties_get(props, "raop.port")) == NULL) if (ip == NULL || port == NULL) {
pw_log_error("Missing raop.ip or raop.port");
res = -EINVAL;
goto error; goto error;
}
if (pw_properties_get(props, PW_KEY_NODE_VIRTUAL) == NULL) if (pw_properties_get(props, PW_KEY_NODE_VIRTUAL) == NULL)
pw_properties_set(props, PW_KEY_NODE_VIRTUAL, "true"); pw_properties_set(props, PW_KEY_NODE_VIRTUAL, "true");
@ -1926,7 +1929,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
if (pw_properties_get(props, PW_KEY_NODE_NAME) == NULL) if (pw_properties_get(props, PW_KEY_NODE_NAME) == NULL)
pw_properties_setf(props, PW_KEY_NODE_NAME, "raop_sink.%s.%s.%s", pw_properties_setf(props, PW_KEY_NODE_NAME, "raop_sink.%s.%s.%s",
hostname, ip, port); hostname, ip, port);
if (pw_properties_get(props, PW_KEY_NODE_DESCRIPTION) == NULL) if (pw_properties_get(props, PW_KEY_NODE_DESCRIPTION) == NULL)
pw_properties_setf(props, PW_KEY_NODE_DESCRIPTION, pw_properties_setf(props, PW_KEY_NODE_DESCRIPTION,
"%s", name); "%s", name);