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
This commit is contained in:
Wim Taymans 2021-03-29 14:05:25 +02:00
parent 3878ad921a
commit ec0b2b8dd7

View file

@ -1554,8 +1554,10 @@ pw_stream_connect(struct pw_stream *stream,
pw_properties_setf(stream->properties, PW_KEY_NODE_TARGET, "%d", target_id); pw_properties_setf(stream->properties, PW_KEY_NODE_TARGET, "%d", target_id);
else if ((str = getenv("PIPEWIRE_NODE")) != NULL) else if ((str = getenv("PIPEWIRE_NODE")) != NULL)
pw_properties_set(stream->properties, PW_KEY_NODE_TARGET, str); pw_properties_set(stream->properties, PW_KEY_NODE_TARGET, str);
if (flags & PW_STREAM_FLAG_AUTOCONNECT) if (flags & PW_STREAM_FLAG_AUTOCONNECT) {
pw_properties_set(stream->properties, PW_KEY_NODE_AUTOCONNECT, "true"); str = getenv("PIPEWIRE_AUTOCONNECT");
pw_properties_set(stream->properties, PW_KEY_NODE_AUTOCONNECT, str ? str : "true");
}
if (flags & PW_STREAM_FLAG_DRIVER) if (flags & PW_STREAM_FLAG_DRIVER)
pw_properties_set(stream->properties, PW_KEY_NODE_DRIVER, "true"); pw_properties_set(stream->properties, PW_KEY_NODE_DRIVER, "true");
if (flags & PW_STREAM_FLAG_EXCLUSIVE) if (flags & PW_STREAM_FLAG_EXCLUSIVE)