From 0441653ce4c73fd754682bb0aa2a82f89d691d3d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 17 Jun 2020 13:17:28 +0200 Subject: [PATCH] jack: use PIPEWIRE_LINK_PASSIVE environment var Let the jack client make passive links when the PIPEWIRE_LINK_PASSIVE variable is set. Makes it possible to start qsynth with passive links so that it suspends when not in use. --- pipewire-jack/src/pipewire-jack.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c index d72d26237..28a8ff822 100644 --- a/pipewire-jack/src/pipewire-jack.c +++ b/pipewire-jack/src/pipewire-jack.c @@ -3672,9 +3672,10 @@ int jack_connect (jack_client_t *client, struct client *c = (struct client *) client; struct object *src, *dst; struct spa_dict props; - struct spa_dict_item items[5]; + struct spa_dict_item items[6]; struct pw_proxy *proxy; char val[4][16]; + const char *str; int res; spa_return_val_if_fail(c != NULL, -EINVAL); @@ -3707,6 +3708,9 @@ int jack_connect (jack_client_t *client, items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_LINK_INPUT_NODE, val[2]); items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_LINK_INPUT_PORT, val[3]); items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_OBJECT_LINGER, "true"); + if ((str = getenv("PIPEWIRE_LINK_PASSIVE")) != NULL && + pw_properties_parse_bool(str)) + items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_LINK_PASSIVE, "true"); proxy = pw_core_create_object(c->core, "link-factory",