stream: also call process when queue is empty

When we just picked a buffer from the queue and it is now empty,
call the process method to fill up the queue again or else we
won't have a buffer for the next wakeup.
This commit is contained in:
Wim Taymans 2020-02-18 13:29:16 +01:00
parent e6c3619521
commit 427a6316d3

View file

@ -776,10 +776,10 @@ again:
if (!impl->draining && if (!impl->draining &&
!SPA_FLAG_IS_SET(impl->flags, PW_STREAM_FLAG_DRIVER) && !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) { spa_ringbuffer_get_read_index(&impl->queued.ring, &index) < MIN_QUEUED) {
call_process(impl); call_process(impl);
if (spa_ringbuffer_get_read_index(&impl->queued.ring, &index) >= MIN_QUEUED) if (spa_ringbuffer_get_read_index(&impl->queued.ring, &index) > 0 &&
io->status == SPA_STATUS_NEED_DATA)
goto again; goto again;
} }
exit: exit: