From d24c8da5d213d3056c432acded5abdf0e7ea9191 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 21 Jun 2023 15:31:16 +0200 Subject: [PATCH] stream: keep calling process when there is data Don't only call the process function when we have a new buffer but also when we still have something in the queue to process. --- src/pipewire/stream.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index baa02bbf7..661773bd1 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -1035,12 +1035,15 @@ static int impl_node_process_input(void *object) /* push new buffer */ pw_log_trace_fp("%p: push %d %p", stream, b->id, io); if (queue_push(impl, &impl->dequeued, b) == 0) { - copy_position(impl, impl->dequeued.incount); if (b->busy) ATOMIC_INC(b->busy->count); - call_process(impl); } } + if (!queue_is_empty(impl, &impl->dequeued)) { + copy_position(impl, impl->dequeued.incount); + call_process(impl); + } + if (io->status != SPA_STATUS_NEED_DATA || io->buffer_id == SPA_ID_INVALID) { /* pop buffer to recycle */ if ((b = queue_pop(impl, &impl->queued))) {