mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: don't change avail when unchanged
Only update the avail when we did a snd_pcm_forward(). Otherwise we might think there is more available than there really is and we might get xrun. See #3395
This commit is contained in:
parent
c9b7367f8f
commit
fd585baa88
1 changed files with 3 additions and 2 deletions
|
|
@ -2498,9 +2498,10 @@ int spa_alsa_read(struct state *state)
|
||||||
|
|
||||||
if (avail < target)
|
if (avail < target)
|
||||||
max_read = target - avail;
|
max_read = target - avail;
|
||||||
else if (avail > target)
|
else if (avail > target) {
|
||||||
snd_pcm_forward(state->hndl, avail - target);
|
snd_pcm_forward(state->hndl, avail - target);
|
||||||
avail = target;
|
avail = target;
|
||||||
|
}
|
||||||
state->alsa_sync = false;
|
state->alsa_sync = false;
|
||||||
} else
|
} else
|
||||||
state->alsa_sync_warning = true;
|
state->alsa_sync_warning = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue