stream: flags should not override properties

Only set the properties from the flags when not already set before.

Fixes #3382
This commit is contained in:
Wim Taymans 2023-07-26 10:44:47 +02:00
parent dd78f3d5f7
commit ae4042e7a2

View file

@ -1983,15 +1983,20 @@ pw_stream_connect(struct pw_stream *stream,
if (target_id != PW_ID_ANY)
/* XXX this is deprecated but still used by the portal and its apps */
if (pw_properties_get(stream->properties, PW_KEY_NODE_TARGET) == NULL)
pw_properties_setf(stream->properties, PW_KEY_NODE_TARGET, "%d", target_id);
if (flags & PW_STREAM_FLAG_AUTOCONNECT)
if (pw_properties_get(stream->properties, PW_KEY_NODE_AUTOCONNECT) == NULL)
pw_properties_set(stream->properties, PW_KEY_NODE_AUTOCONNECT, "true");
if (flags & PW_STREAM_FLAG_DRIVER)
pw_properties_set(stream->properties, PW_KEY_NODE_DRIVER, "true");
if (flags & PW_STREAM_FLAG_EXCLUSIVE)
if (pw_properties_get(stream->properties, PW_KEY_NODE_EXCLUSIVE) == NULL)
pw_properties_set(stream->properties, PW_KEY_NODE_EXCLUSIVE, "true");
if (flags & PW_STREAM_FLAG_DONT_RECONNECT)
if (pw_properties_get(stream->properties, PW_KEY_NODE_DONT_RECONNECT) == NULL)
pw_properties_set(stream->properties, PW_KEY_NODE_DONT_RECONNECT, "true");
if (flags & PW_STREAM_FLAG_DRIVER)
pw_properties_set(stream->properties, PW_KEY_NODE_DRIVER, "true");
if (flags & PW_STREAM_FLAG_TRIGGER) {
pw_properties_set(stream->properties, PW_KEY_NODE_TRIGGER, "true");
impl->trigger = true;