mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: fix impossible timeouts
Use the avail and read_size to calculate the next timeout, not delay and target, which could give a negative value and impossible timeout.
This commit is contained in:
parent
61ce16b19f
commit
90e2f4a139
1 changed files with 1 additions and 1 deletions
|
|
@ -2509,7 +2509,7 @@ static int handle_capture(struct state *state, uint64_t current_time, snd_pcm_uf
|
|||
if (SPA_UNLIKELY(avail < state->read_size)) {
|
||||
spa_log_trace(state->log, "%p: early wakeup %ld %ld %ld %d", state,
|
||||
delay, avail, target, state->read_size);
|
||||
state->next_time = current_time + (target - delay) * SPA_NSEC_PER_SEC /
|
||||
state->next_time = current_time + (state->read_size - avail) * SPA_NSEC_PER_SEC /
|
||||
state->rate;
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue