mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pulse-server: avoid skipping more ringbuffer data than available
This prevents the ringbuffer from advancing the read pointer more than the size of data actually available. It prevents the "avail" value from keeping to drop when no audio is being played by the client. Applying this patch seems to prevent the "randomly playing music after a couple hours of silence" issue Fixes #2366
This commit is contained in:
parent
9240a7b6f3
commit
aa33c2841c
1 changed files with 1 additions and 1 deletions
|
|
@ -1288,10 +1288,10 @@ static void stream_process(void *data)
|
||||||
stream->buffer, MAXLENGTH,
|
stream->buffer, MAXLENGTH,
|
||||||
index % MAXLENGTH,
|
index % MAXLENGTH,
|
||||||
p, avail);
|
p, avail);
|
||||||
|
index += avail;
|
||||||
}
|
}
|
||||||
pd.playing_for = size;
|
pd.playing_for = size;
|
||||||
pd.read_inc = size;
|
pd.read_inc = size;
|
||||||
index += size;
|
|
||||||
spa_ringbuffer_read_update(&stream->ring, index);
|
spa_ringbuffer_read_update(&stream->ring, index);
|
||||||
}
|
}
|
||||||
pw_log_debug("%p: [%s] underrun read:%u avail:%d max:%u",
|
pw_log_debug("%p: [%s] underrun read:%u avail:%d max:%u",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue