scheduler: prepare link before usage

A link might become unprepared because a node suspended. When we want
to make the nodes runnable, make sure the link is prepared again.
This commit is contained in:
Wim Taymans 2026-02-21 17:25:54 +01:00
parent 476220c18b
commit 846096d435
3 changed files with 22 additions and 17 deletions

View file

@ -204,27 +204,28 @@ static void check_runnable(struct pw_context *context, struct pw_impl_node *node
spa_list_for_each(p, &node->output_ports, link) {
spa_list_for_each(l, &p->links, output_link) {
n = l->input->node;
/* we can only check the peer when the link is ready and
* the peer is active */
if (!l->prepared || !n->active)
/* the peer needs to be active and we are linked to it
* with a non-passive link */
if (!n->active || p->passive)
continue;
if (!p->passive) {
make_runnable(context, node);
make_runnable(context, n);
}
/* explicitly prepare the link in case it was suspended */
pw_impl_link_prepare(l);
if (!l->prepared)
continue;
make_runnable(context, node);
make_runnable(context, n);
}
}
spa_list_for_each(p, &node->input_ports, link) {
spa_list_for_each(l, &p->links, input_link) {
n = l->output->node;
if (!l->prepared || !n->active)
if (!n->active || p->passive)
continue;
if (!p->passive) {
make_runnable(context, node);
make_runnable(context, n);
}
pw_impl_link_prepare(l);
if (!l->prepared)
continue;
make_runnable(context, node);
make_runnable(context, n);
}
}
}