ao: don't add buffer length to timeout twice

ao_get_delay already adds this buffer length
This commit is contained in:
llyyr 2024-07-09 10:54:00 +05:30 committed by sfan5
parent 2559f8874f
commit 1fd9389911
1 changed files with 1 additions and 4 deletions

View File

@ -484,10 +484,7 @@ void ao_drain(struct ao *ao)
double delay = ao_get_delay(ao); double delay = ao_get_delay(ao);
mp_mutex_lock(&p->lock); mp_mutex_lock(&p->lock);
// Limit to buffer + arbitrary ~250ms max. waiting for robustness. // Wait for buffer + arbitrary ~250ms for EOF signal from AO.
delay += mp_async_queue_get_samples(p->queue) / (double)ao->samplerate;
// Wait for EOF signal from AO.
if (mp_cond_timedwait(&p->wakeup, &p->lock, if (mp_cond_timedwait(&p->wakeup, &p->lock,
MP_TIME_S_TO_NS(MPMAX(delay, 0) + 0.25))) MP_TIME_S_TO_NS(MPMAX(delay, 0) + 0.25)))
{ {