mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pulse-server: use partial data as missing/played for
When we can't fill a complete block, report the amount of data that we used in missing/played instead of the complete missing part. Fixes audio breaking up when looping in mpv. Fixes #1132
This commit is contained in:
parent
3de9d3df3b
commit
08b18b9da4
1 changed files with 5 additions and 2 deletions
|
|
@ -1259,8 +1259,6 @@ static void stream_process(void *data)
|
|||
pd.underrun = true;
|
||||
}
|
||||
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,
|
||||
|
|
@ -1268,6 +1266,11 @@ static void stream_process(void *data)
|
|||
p, avail);
|
||||
index += avail;
|
||||
pd.read_inc = avail;
|
||||
pd.missing = avail;
|
||||
pd.playing_for = avail;
|
||||
} else {
|
||||
pd.missing = size;
|
||||
pd.playing_for = size;
|
||||
}
|
||||
spa_ringbuffer_read_update(&stream->ring, index);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue