From c581804603b01218de6b135b4b3156e837af15e4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 24 Jul 2015 17:27:04 +0200 Subject: audio: fix EOF state with --keep-open In paused mode, we never entered the audio EOF state. This shows e.g. in --keep-open mode, which will not set the eof-reached property correctly. Regression since commit c06cd1b9. This commit was the wrong fix. We need to respect the buffer state, and pausing has nothing to do with this. Fixes #2167. --- player/audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/player/audio.c b/player/audio.c index cfad9e8195..48b14b735d 100644 --- a/player/audio.c +++ b/player/audio.c @@ -609,7 +609,7 @@ void fill_audio_out_buffers(struct MPContext *mpctx, double endpts) mp_audio_buffer_skip(mpctx->ao_buffer, played); mpctx->audio_status = STATUS_PLAYING; - if (audio_eof && !mpctx->paused) { + if (audio_eof && !mp_audio_buffer_samples(mpctx->ao_buffer)) { 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. -- cgit v1.2.3