mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-09-20 00:11:31 +00:00
alsa: CLAMP the error just in case something goes wrong.
The calculation of the elapsed time is actually not a good idea because it becomes larger and larger and a tiny change in the rate could result in a large difference that would make things fail quickly. Until that is fixed, this patch will need to do..
This commit is contained in:
parent
5fa1ae99ae
commit
c2c7dd040a
|
@ -732,6 +732,7 @@ static int update_time(struct seq_state *state, uint64_t nsec, bool follower)
|
|||
queue_elapsed = NSEC_TO_CLOCK(state->clock, state->queue_time) / corr;
|
||||
|
||||
err = ((int64_t)clock_elapsed - (int64_t) queue_elapsed);
|
||||
err = SPA_CLAMP(err, -64, 64);
|
||||
|
||||
if (state->dll.bw == 0.0) {
|
||||
spa_dll_set_bw(&state->dll, SPA_DLL_BW_MAX, state->threshold,
|
||||
|
|
Loading…
Reference in a new issue