From f96c7ede11cce80ad08a625a5f7126f7525e8081 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 21 Jan 2021 13:41:06 +0100 Subject: [PATCH] stream: handle drain from process When process calls drain, also do one more loop to complete the drain. --- src/pipewire/stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index 2919d0859..e0d861eb0 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -857,7 +857,8 @@ again: /* realtime and we don't have a buffer, trigger process and try * again when there is something in the queue now */ call_process(impl); - if (spa_ringbuffer_get_read_index(&impl->queued.ring, &index) > 0) + if (impl->draining || + spa_ringbuffer_get_read_index(&impl->queued.ring, &index) > 0) goto again; } }