From bd04af6cc95c39f220d7164189424cad35795fcb Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 12 Apr 2023 12:05:47 +0200 Subject: [PATCH] context: handle non-passive driver links to itself A non-passive link between the driver and itself should make the driver active as well. This makes the midi-bridge running when linking its ports. It also activates a sink when its monitor ports are connected to its playback ports. Fixes #3153 --- src/pipewire/context.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/pipewire/context.c b/src/pipewire/context.c index 6683c5a19..5b0b80b60 100644 --- a/src/pipewire/context.c +++ b/src/pipewire/context.c @@ -885,13 +885,16 @@ static int collect_nodes(struct pw_context *context, struct pw_impl_node *node, pw_impl_link_prepare(l); - if (!l->prepared || t->visited) + if (!l->prepared || (t != n && t->visited)) continue; if (!l->passive) t->runnable = true; - t->visited = true; - spa_list_append(&queue, &t->sort_link); + + if (!t->visited) { + t->visited = true; + spa_list_append(&queue, &t->sort_link); + } } } spa_list_for_each(p, &n->output_ports, link) { @@ -903,13 +906,16 @@ static int collect_nodes(struct pw_context *context, struct pw_impl_node *node, pw_impl_link_prepare(l); - if (!l->prepared || t->visited) + if (!l->prepared || (t != n && t->visited)) continue; if (!l->passive) t->runnable = true; - t->visited = true; - spa_list_append(&queue, &t->sort_link); + + if (!t->visited) { + t->visited = true; + spa_list_append(&queue, &t->sort_link); + } } } /* now go through all the nodes that have the same group and