From 901388ae00f3c0ccdd3bc8d891f22b556f3cbc36 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 18 Jun 2023 17:09:15 +0200 Subject: [PATCH] stream: PIPEWIRE_AUTOCONNECT env overrides config Always make the env variable override any config setting. See #3299 --- src/pipewire/stream.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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");