pulse-server: read in chunks of minreq from the ringbuffer

Don't read too large chunks from the ringbuffer but in minreq
increments. This is more what pulseaudio does.

Fixes #463
This commit is contained in:
Wim Taymans 2020-12-11 12:45:01 +01:00
parent d3db703f77
commit bcf6c0986e

View file

@ -1452,6 +1452,7 @@ static void stream_process(void *data)
avail = stream->attr.maxlength; avail = stream->attr.maxlength;
} }
size = SPA_MIN(buf->datas[0].maxsize, (uint32_t)avail); size = SPA_MIN(buf->datas[0].maxsize, (uint32_t)avail);
size = SPA_MIN(size, stream->attr.minreq);
spa_ringbuffer_read_data(&stream->ring, spa_ringbuffer_read_data(&stream->ring,
stream->buffer, stream->attr.maxlength, stream->buffer, stream->attr.maxlength,