mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: fix threshold sign
Be careful when converting the uint32_t to int64_t, first convert and then flip the sign.
This commit is contained in:
parent
937a13d93f
commit
159fa7177a
1 changed files with 1 additions and 1 deletions
|
|
@ -2016,7 +2016,7 @@ static int get_avail(struct state *state, uint64_t current_time, snd_pcm_uframes
|
|||
spa_log_trace_fp(state->log, "%"PRIu64" %"PRIu64" %"PRIi64, current_time, then, diff);
|
||||
|
||||
if (SPA_ABS(diff) < state->threshold * 3) {
|
||||
*delay += SPA_CLAMP(diff, -state->threshold, state->threshold);
|
||||
*delay += SPA_CLAMP(diff, -((int64_t)state->threshold), (int64_t)state->threshold);
|
||||
state->htimestamp_error = 0;
|
||||
} else {
|
||||
if (++state->htimestamp_error > MAX_HTIMESTAMP_ERROR) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue