pulse-server: recover for underrun better

If we are underrun, don't update the read pointer and let the write
pointer catch up.
If we don't have enough data to fill a buffer, skip all the available
data and wait for the new request to arrive.

Fixes #1857
This commit is contained in:
Wim Taymans 2021-11-29 20:22:05 +01:00
parent 3df6e77996
commit 700a22b7f7

View file

@ -1243,8 +1243,10 @@ static void stream_process(void *data)
if (stream->attr.prebuf == 0 && !stream->corked) { if (stream->attr.prebuf == 0 && !stream->corked) {
pd.missing = size; pd.missing = size;
pd.playing_for = size; pd.playing_for = size;
index += size; if (avail > 0) {
pd.read_inc = size; index += avail;
pd.read_inc = avail;
}
spa_ringbuffer_read_update(&stream->ring, index); spa_ringbuffer_read_update(&stream->ring, index);
} }
} else { } else {