mirror of https://github.com/mpv-player/mpv
ao: don't add buffer length to timeout twice
ao_get_delay already adds this buffer length
This commit is contained in:
parent
2559f8874f
commit
1fd9389911
|
@ -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)))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue