pulse: fix drain

The drain operation does not complete with a sync from the server but
with an event from the stream. Set a flag in the operation that it
completes with a sync. Keep all operations without a sync around in
the list.
This commit is contained in:
Wim Taymans 2020-09-17 11:48:21 +02:00
parent a9c0435317
commit 688041b083
4 changed files with 12 additions and 1 deletions

View file

@ -1473,13 +1473,20 @@ static void core_done(void *data, uint32_t id, int seq)
}
}
spa_list_for_each_safe(o, t, &ops, link) {
if (!o->sync)
continue;
pa_operation_ref(o);
pw_log_debug("operation %p complete", o);
pw_log_debug("sync operation %p complete", o);
if (o->callback)
o->callback(o, o->userdata);
pa_operation_unref(o);
}
spa_list_consume(o, &ops, link) {
if (!o->sync) {
spa_list_remove(&o->link);
spa_list_append(&c->operations, &o->link);
continue;
}
pw_log_warn("operation %p canceled", o);
pa_operation_cancel(o);
}