alsa: reschedule the timeout based on new quantum

Always reschedule the timeout based on the new quantum. If the
quantum descreased we want to wait some more until the buffer only
has the new quantum of samples left.
This commit is contained in:
Wim Taymans 2021-03-03 17:01:12 +01:00
parent 3bcc59120a
commit a36af57899

View file

@ -1264,7 +1264,7 @@ static int handle_play(struct state *state, uint64_t nsec,
{
int res;
if (SPA_UNLIKELY(delay > target + state->last_threshold)) {
if (SPA_UNLIKELY(delay > target + state->threshold)) {
spa_log_trace(state->log, NAME" %p: early wakeup %ld %ld", state, delay, target);
state->next_time = nsec + (delay - target) * SPA_NSEC_PER_SEC / state->rate;
return -EAGAIN;