mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: handle excessive delay values gracefully
When we read an excessively large delay value, clamp it to twice the delay so that we don't set our timeout to something too far in the future.
This commit is contained in:
parent
3300f5ddc4
commit
71055dce73
1 changed files with 3 additions and 1 deletions
|
|
@ -1626,7 +1626,9 @@ static int handle_play(struct state *state, uint64_t nsec,
|
|||
int res;
|
||||
|
||||
if (SPA_UNLIKELY(delay > target + state->max_error)) {
|
||||
spa_log_trace(state->log, NAME" %p: early wakeup %ld %ld", state, delay, target);
|
||||
spa_log_trace(state->log, NAME" %p: early wakeup %lu %lu", state, delay, target);
|
||||
if (delay > target * 3)
|
||||
delay = target * 3;
|
||||
state->next_time = nsec + (delay - target) * SPA_NSEC_PER_SEC / state->rate;
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue