alsa: use rewind to remove excess delay

When the delay is too big, rewind a little to reduce it when resync.
This commit is contained in:
Wim Taymans 2022-02-16 21:10:03 +01:00
parent 5b9ec53bf8
commit 4246961070

View file

@ -1889,7 +1889,7 @@ int spa_alsa_write(struct state *state)
spa_log_warn(state->log, "%s: follower delay:%ld target:%ld thr:%u, resync",
state->props.device, delay, target, state->threshold);
if (delay > target)
max_write = delay - target;
snd_pcm_rewind(state->hndl, delay - target);
else if (delay < target)
spa_alsa_silence(state, target - delay);
delay = target;