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.
This commit is contained in:
Wim Taymans 2021-03-10 15:27:06 +01:00
parent 78e9e5958e
commit ef4b3c403e

View file

@ -702,7 +702,8 @@ static int rescan_node(struct impl *impl, struct node *n)
n->type == NODE_TYPE_STREAM && n->type == NODE_TYPE_STREAM &&
reconnect && reconnect &&
n->obj->target_node == NULL && 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) { if (n->peer != NULL && !follows_default) {
pw_log_debug(NAME " %p: node %d is already linked", impl, n->id); pw_log_debug(NAME " %p: node %d is already linked", impl, n->id);