mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
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:
parent
b223261240
commit
d2f676f9a6
1 changed files with 5 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue