mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
pulse-tunnel: fix index after overrun
First advance the index, then fix the avail value or else we don't end up changing the index at all.
This commit is contained in:
parent
9f66c42d1f
commit
f25da522a4
1 changed files with 1 additions and 1 deletions
|
|
@ -399,8 +399,8 @@ static void capture_stream_process(void *d)
|
||||||
if (avail < (int32_t)size)
|
if (avail < (int32_t)size)
|
||||||
memset(bd->data, 0, size);
|
memset(bd->data, 0, size);
|
||||||
if (avail > (int32_t)RINGBUFFER_SIZE) {
|
if (avail > (int32_t)RINGBUFFER_SIZE) {
|
||||||
avail = impl->target_buffer;
|
|
||||||
index += avail - impl->target_buffer;
|
index += avail - impl->target_buffer;
|
||||||
|
avail = impl->target_buffer;
|
||||||
}
|
}
|
||||||
if (avail > 0) {
|
if (avail > 0) {
|
||||||
avail = SPA_ROUND_DOWN(avail, impl->frame_size);
|
avail = SPA_ROUND_DOWN(avail, impl->frame_size);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue