From 279e6706b26850d60e33921c2e1a968ea6a0753d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 3 Dec 2019 17:48:44 +0200 Subject: [PATCH] stream: do not call process if the queue is not empty enough --- src/pipewire/stream.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index 194346347..b5a2caf36 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -775,10 +775,12 @@ again: } } - if (!impl->draining && !SPA_FLAG_IS_SET(impl->flags, PW_STREAM_FLAG_DRIVER)) { + if (!impl->draining && + !SPA_FLAG_IS_SET(impl->flags, PW_STREAM_FLAG_DRIVER) && + io->status == SPA_STATUS_NEED_DATA && + spa_ringbuffer_get_read_index(&impl->queued.ring, &index) < MIN_QUEUED) { call_process(impl); - if (spa_ringbuffer_get_read_index(&impl->queued.ring, &index) >= MIN_QUEUED && - io->status == SPA_STATUS_NEED_DATA) + if (spa_ringbuffer_get_read_index(&impl->queued.ring, &index) >= MIN_QUEUED) goto again; } exit: