diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index 2d0c9ea3d..baa02bbf7 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -2007,10 +2007,12 @@ pw_stream_connect(struct pw_stream *stream, /* XXX this is deprecated but still used by the portal and its apps */ pw_properties_setf(stream->properties, PW_KEY_NODE_TARGET, "%d", target_id); - if ((flags & PW_STREAM_FLAG_AUTOCONNECT) && + if ((str = getenv("PIPEWIRE_AUTOCONNECT")) != NULL) + pw_properties_set(stream->properties, + PW_KEY_NODE_AUTOCONNECT, spa_atob(str) ? "true" : "false"); + else if ((flags & PW_STREAM_FLAG_AUTOCONNECT) && pw_properties_get(stream->properties, PW_KEY_NODE_AUTOCONNECT) == NULL) { - str = getenv("PIPEWIRE_AUTOCONNECT"); - pw_properties_set(stream->properties, PW_KEY_NODE_AUTOCONNECT, str ? str : "true"); + 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");