context: keep passive links negotiated

Always make sure passive links are prepared so we can follow them
and use them to activate nodes.
This commit is contained in:
Wim Taymans 2020-06-17 13:53:24 +02:00
parent 741a2b3dcc
commit 389b4a72f8

View file

@ -798,18 +798,22 @@ static int collect_nodes(struct pw_impl_node *driver)
spa_list_init(&queue); spa_list_init(&queue);
spa_list_append(&queue, &driver->sort_link); spa_list_append(&queue, &driver->sort_link);
driver->visited = true; driver->visited = true;
driver->passive = true;
spa_list_consume(n, &queue, sort_link) { spa_list_consume(n, &queue, sort_link) {
spa_list_remove(&n->sort_link); spa_list_remove(&n->sort_link);
pw_impl_node_set_driver(n, driver); pw_impl_node_set_driver(n, driver);
n->passive = true;
spa_list_for_each(p, &n->input_ports, link) { spa_list_for_each(p, &n->input_ports, link) {
spa_list_for_each(l, &p->links, input_link) { spa_list_for_each(l, &p->links, input_link) {
t = l->output->node; t = l->output->node;
if (!l->passive) if (!l->passive)
driver->passive = false; driver->passive = n->passive = false;
if (l->prepared && !t->visited && t->active) { else
pw_impl_link_prepare(l);
if (t->visited || !t->active)
continue;
if (l->prepared) {
t->visited = true; t->visited = true;
spa_list_append(&queue, &t->sort_link); spa_list_append(&queue, &t->sort_link);
} }
@ -819,8 +823,12 @@ static int collect_nodes(struct pw_impl_node *driver)
spa_list_for_each(l, &p->links, output_link) { spa_list_for_each(l, &p->links, output_link) {
t = l->input->node; t = l->input->node;
if (!l->passive) if (!l->passive)
driver->passive = false; driver->passive = n->passive = false;
if (l->prepared && !t->visited && t->active) { else
pw_impl_link_prepare(l);
if (t->visited || !t->active)
continue;
if (l->prepared) {
t->visited = true; t->visited = true;
spa_list_append(&queue, &t->sort_link); spa_list_append(&queue, &t->sort_link);
} }