From ec0b2b8dd7fc3c419e0b05ce6ce8375d8c0cd08f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 29 Mar 2021 14:05:25 +0200 Subject: [PATCH] stream: use PIPEWIRE_AUTOCONNECT env variable Use the PIPEWIRE_AUTOCONNECT environment variable to set the value of the NODE_AUTOCONNECT property. This way, you can start any stream based app with PIPEWIRE_AUTOCONNECT=false to disable the session manager autoconnect. See #964 --- src/pipewire/stream.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index 9e9952c1e..baa0acdb5 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -1554,8 +1554,10 @@ pw_stream_connect(struct pw_stream *stream, pw_properties_setf(stream->properties, PW_KEY_NODE_TARGET, "%d", target_id); else if ((str = getenv("PIPEWIRE_NODE")) != NULL) pw_properties_set(stream->properties, PW_KEY_NODE_TARGET, str); - if (flags & PW_STREAM_FLAG_AUTOCONNECT) - pw_properties_set(stream->properties, PW_KEY_NODE_AUTOCONNECT, "true"); + if (flags & PW_STREAM_FLAG_AUTOCONNECT) { + str = getenv("PIPEWIRE_AUTOCONNECT"); + pw_properties_set(stream->properties, PW_KEY_NODE_AUTOCONNECT, str ? str : "true"); + } if (flags & PW_STREAM_FLAG_DRIVER) pw_properties_set(stream->properties, PW_KEY_NODE_DRIVER, "true"); if (flags & PW_STREAM_FLAG_EXCLUSIVE)