diff options
author | wm4 <wm4@nowhere> | 2016-08-24 12:14:48 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-08-24 12:14:48 +0200 |
commit | c4ba600832ad5338bc7eba6c655cb33104237d82 (patch) | |
tree | dd04fd8f4b357a52e15968840ebfcb7eef4a8180 | |
parent | c218d9e960e906e4d6dab9d2c4438022b91c69bc (diff) | |
download | mpv-c4ba600832ad5338bc7eba6c655cb33104237d82.tar.bz2 mpv-c4ba600832ad5338bc7eba6c655cb33104237d82.tar.xz |
audio: avoid missed wakeups with ab-loops
Could get "stuck".
-rw-r--r-- | player/audio.c | 6 |
1 files changed, 5 insertions, 1 deletions
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; + } } } |