mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
context: handle the fallback node correctly
A passive node can still be the fallback node. It becomes non-passive if there is a node assigned to it. This makes the Dummy node work again in the case of jack clients that always need to be scheduled.
This commit is contained in:
parent
1bf6dead10
commit
51b6c2cbd7
1 changed files with 9 additions and 4 deletions
|
|
@ -897,13 +897,16 @@ int pw_context_recalc_graph(struct pw_context *context, const char *reason)
|
||||||
|
|
||||||
/* from now on we are only interested in active driving nodes.
|
/* from now on we are only interested in active driving nodes.
|
||||||
* We're going to see if there are active followers. */
|
* We're going to see if there are active followers. */
|
||||||
if (!n->driving || !n->active || n->passive)
|
if (!n->driving || !n->active)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* first active driving node is fallback */
|
/* first active driving node is fallback */
|
||||||
if (fallback == NULL)
|
if (fallback == NULL)
|
||||||
fallback = n;
|
fallback = n;
|
||||||
|
|
||||||
|
if (n->passive)
|
||||||
|
continue;
|
||||||
|
|
||||||
spa_list_for_each(s, &n->follower_list, follower_link) {
|
spa_list_for_each(s, &n->follower_list, follower_link) {
|
||||||
pw_log_debug(NAME" %p: driver %p: follower %p %s: active:%d",
|
pw_log_debug(NAME" %p: driver %p: follower %p %s: active:%d",
|
||||||
context, n, s, s->name, s->active);
|
context, n, s, s->name, s->active);
|
||||||
|
|
@ -930,14 +933,16 @@ int pw_context_recalc_graph(struct pw_context *context, const char *reason)
|
||||||
if (!n->visited) {
|
if (!n->visited) {
|
||||||
struct pw_impl_node *t;
|
struct pw_impl_node *t;
|
||||||
|
|
||||||
pw_log_debug(NAME" %p: unassigned node %p: '%s' active:%d want_driver:%d",
|
pw_log_debug(NAME" %p: unassigned node %p: '%s' active:%d want_driver:%d target:%p",
|
||||||
context, n, n->name, n->active, n->want_driver);
|
context, n, n->name, n->active, n->want_driver, target);
|
||||||
|
|
||||||
t = n->active && n->want_driver ? target : NULL;
|
t = (n->active && n->want_driver) ? target : NULL;
|
||||||
|
|
||||||
pw_impl_node_set_driver(n, t);
|
pw_impl_node_set_driver(n, t);
|
||||||
if (t == NULL)
|
if (t == NULL)
|
||||||
ensure_state(n, false);
|
ensure_state(n, false);
|
||||||
|
else
|
||||||
|
t->passive = false;
|
||||||
}
|
}
|
||||||
n->visited = false;
|
n->visited = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue