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