pulse-server: don't read more than requested size

When we underrun, don't try to read more than what was requested
even if there is more in the ringbuffer.
This commit is contained in:
Wim Taymans 2022-09-26 13:23:07 +02:00
parent 2d858e0ba2
commit e0d1be32fd

View file

@ -1422,7 +1422,7 @@ static void stream_process(void *data)
spa_ringbuffer_read_data(&stream->ring, spa_ringbuffer_read_data(&stream->ring,
stream->buffer, MAXLENGTH, stream->buffer, MAXLENGTH,
index % MAXLENGTH, index % MAXLENGTH,
p, avail); p, SPA_MIN((uint32_t)avail, size));
index += avail; index += avail;
} }
pd.playing_for = size; pd.playing_for = size;