stream: only try to send again when needed

We should only try to send data when the process call prepared new
data for us and we didn't already have data.
This commit is contained in:
Wim Taymans 2018-05-24 16:16:11 +02:00
parent 5a1bd77fb5
commit 3fdeb64ddb

View file

@ -769,7 +769,8 @@ static int impl_node_process_output(struct spa_node *node)
} else {
if (!SPA_FLAG_CHECK(impl->flags, PW_STREAM_FLAG_DRIVER)) {
call_process(impl);
if (spa_ringbuffer_get_read_index(&impl->queued.ring, &index) > 0)
if (spa_ringbuffer_get_read_index(&impl->queued.ring, &index) > 0 &&
io->status == SPA_STATUS_NEED_BUFFER)
goto again;
}
res = io->status;