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
This commit is contained in:
Wim Taymans 2023-04-12 12:05:47 +02:00
parent 2a5c23c811
commit bd04af6cc9

View file

@ -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