context: don't move passive nodes to fallback driver

Don't move passive nodes to the fallback driver when !always_process.

When we have a fallback driver, check if the node we want to add to it
is not a passive node (by doing collect_nodes), if it's passive and
doesn't always need to be processed, remove it from the driver.

This fixes the issue where nodes that are maked as want_driver are
unconditionally moved to the fallback driver (and activated) even if
there is nothing linked to them (passive).

Fixes #2309
This commit is contained in:
Wim Taymans 2022-04-18 15:59:26 +02:00
parent 1809a84562
commit ae194b6fe7

View file

@ -1191,11 +1191,21 @@ again:
context, n, n->name, n->active, n->want_driver, target);
t = n->want_driver && n->active ? target : NULL;
if (t != NULL && !n->always_process) {
/* first do a check without moving the node to
* the target driver to see if we are passive */
collect_nodes(context, n);
if (n->passive)
t = NULL;
}
pw_impl_node_set_driver(n, t);
if (t == NULL)
if (t == NULL) {
/* no driver, make sure the node stops */
ensure_state(n, false);
}
else {
/* we configured a driver, move all linked
* nodes to it as well */
if (n->always_process)
t->passive = false;
collect_nodes(context, n);