pulser-server: push data instead of silence

When we are draining or underrunning, read whatever we have in the
ringbuffer instead of silence. This places the last samples before
the drain into the sink, padded with 0.

Fixes #1549
This commit is contained in:
Wim Taymans 2021-12-18 12:32:44 +01:00
parent b223261240
commit d2f676f9a6

View file

@ -1258,10 +1258,14 @@ static void stream_process(void *data)
pd.underrun_for = size;
pd.underrun = true;
}
if (stream->attr.prebuf == 0 && !stream->corked) {
if ((stream->attr.prebuf == 0 || do_flush) && !stream->corked) {
pd.missing = size;
pd.playing_for = size;
if (avail > 0) {
spa_ringbuffer_read_data(&stream->ring,
stream->buffer, stream->attr.maxlength,
index % stream->attr.maxlength,
p, avail);
index += avail;
pd.read_inc = avail;
}