context: fix passive node check

A node starts out as passive but becomes non-passive when there
is a non-passive link to an active node. If there is a link to
an inactive node, the node remains passive.

This fixes suspend of drivers in all cases.

Fixes #898
This commit is contained in:
Wim Taymans 2021-03-16 15:48:55 +01:00
parent 75b4c80dc6
commit f2b537bb65

View file

@ -874,10 +874,12 @@ static int collect_nodes(struct pw_context *context, struct pw_impl_node *driver
spa_list_for_each(p, &n->input_ports, link) {
spa_list_for_each(l, &p->links, input_link) {
t = l->output->node;
if (!l->passive)
driver->passive = n->passive = false;
else
if (l->passive)
pw_impl_link_prepare(l);
else if (t->active)
driver->passive = n->passive = false;
if (t->visited || !t->active)
continue;
if (l->prepared) {
@ -889,10 +891,12 @@ static int collect_nodes(struct pw_context *context, struct pw_impl_node *driver
spa_list_for_each(p, &n->output_ports, link) {
spa_list_for_each(l, &p->links, output_link) {
t = l->input->node;
if (!l->passive)
driver->passive = n->passive = false;
else
if (l->passive)
pw_impl_link_prepare(l);
else if (t->active)
driver->passive = n->passive = false;
if (t->visited || !t->active)
continue;
if (l->prepared) {