context: make sure we clear the visited flag

Do a separate pass to clear the visited flag of the nodes because
collect_nodes might set them after we cleared them.
This commit is contained in:
Wim Taymans 2022-04-20 10:43:57 +02:00
parent d0886a16a2
commit e21efd40bb

View file

@ -1179,13 +1179,11 @@ again:
/* now go through all available nodes. The ones we didn't visit
* in collect_nodes() are not linked to any driver. We assign them
* to either an active driver of the first driver */
* to either an active driver or the first driver */
spa_list_for_each(n, &context->node_list, link) {
if (n->exported)
continue;
if (!n->visited) {
struct pw_impl_node *t;
if (n->exported || n->visited)
continue;
pw_log_debug("%p: unassigned node %p: '%s' active:%d want_driver:%d target:%p",
context, n, n->name, n->active, n->want_driver, target);
@ -1210,8 +1208,8 @@ again:
ensure_state(n, false);
}
}
spa_list_for_each(n, &context->node_list, link)
n->visited = false;
}
/* assign final quantum and set state for followers and drivers */
spa_list_for_each(n, &context->driver_list, driver_link) {