pulse: first sync globals, then try operations

First sync the globals and if no global created new pending operations,
run through the operations. This ensures no operation is run before
all globals have data.
This commit is contained in:
Wim Taymans 2020-09-30 10:14:44 +02:00
parent 60df925dfd
commit 19c9a55050

View file

@ -1492,17 +1492,20 @@ static void core_done(void *data, uint32_t id, int seq)
if (c->pending_seq != seq) if (c->pending_seq != seq)
return; return;
spa_list_init(&ops);
spa_list_consume(o, &c->operations, link) {
spa_list_remove(&o->link);
spa_list_append(&ops, &o->link);
}
spa_list_for_each(g, &c->globals, link) { spa_list_for_each(g, &c->globals, link) {
if (g->sync) { if (g->sync) {
do_global_sync(g); do_global_sync(g);
g->sync = false; g->sync = false;
} }
} }
if (c->pending_seq != seq)
return;
spa_list_init(&ops);
spa_list_consume(o, &c->operations, link) {
spa_list_remove(&o->link);
spa_list_append(&ops, &o->link);
}
spa_list_for_each_safe(o, t, &ops, link) { spa_list_for_each_safe(o, t, &ops, link) {
if (!o->sync) if (!o->sync)
continue; continue;