From ef4b3c403e735c966ac8facf9753d04a55765880 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 10 Mar 2021 15:27:06 +0100 Subject: [PATCH] media-session: -1 as node.target is default A node.target property of -1 also means to follow the default sink/source. The ALSA plugin might use this to select the target node and would otherwise not move to the new default sink. --- src/examples/media-session/policy-node.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/examples/media-session/policy-node.c b/src/examples/media-session/policy-node.c index f6547e2aa..c81b93596 100644 --- a/src/examples/media-session/policy-node.c +++ b/src/examples/media-session/policy-node.c @@ -702,7 +702,8 @@ static int rescan_node(struct impl *impl, struct node *n) n->type == NODE_TYPE_STREAM && reconnect && n->obj->target_node == NULL && - spa_dict_lookup(props, PW_KEY_NODE_TARGET) == NULL); + ((str = spa_dict_lookup(props, PW_KEY_NODE_TARGET)) == NULL || + (uint32_t)atoi(str) == SPA_ID_INVALID)); if (n->peer != NULL && !follows_default) { pw_log_debug(NAME " %p: node %d is already linked", impl, n->id);