From c4ba600832ad5338bc7eba6c655cb33104237d82 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 24 Aug 2016 12:14:48 +0200 Subject: audio: avoid missed wakeups with ab-loops Could get "stuck". --- player/audio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/player/audio.c b/player/audio.c index 85c7a75c29..89f75d9095 100644 --- a/player/audio.c +++ b/player/audio.c @@ -862,6 +862,7 @@ void fill_audio_out_buffers(struct MPContext *mpctx) { struct MPOpts *opts = mpctx->opts; struct ao_chain *ao_c = mpctx->ao_chain; + bool was_eof = mpctx->audio_status == STATUS_EOF; dump_audio_stats(mpctx); @@ -1082,8 +1083,11 @@ void fill_audio_out_buffers(struct MPContext *mpctx) mpctx->audio_status = STATUS_DRAINING; // Wait until the AO has played all queued data. In the gapless case, // we trigger EOF immediately, and let it play asynchronously. - if (ao_eof_reached(mpctx->ao) || opts->gapless_audio) + if (ao_eof_reached(mpctx->ao) || opts->gapless_audio) { mpctx->audio_status = STATUS_EOF; + if (!was_eof) + mpctx->sleeptime = 0; + } } } -- cgit v1.2.3