From fc0fa9a221882647da563acc2d22eac0f27b1120 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 31 Aug 2014 14:47:05 +0200 Subject: audio: go to draining state instead of EOF if audio starts later Probably no observable effect, but it's more correct. Setting audio to EOF could have bad effects otherwise (anywhere the player logic for example decides whether EOF was reached, and such). --- player/audio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'player') diff --git a/player/audio.c b/player/audio.c index ebc9416202..e3d3d57bd1 100644 --- a/player/audio.c +++ b/player/audio.c @@ -434,7 +434,7 @@ void fill_audio_out_buffers(struct MPContext *mpctx, double endpts) // If EOF was reached before, but now something can be decoded, try to // restart audio properly. This helps with video files where audio starts // later. Retrying is needed to get the correct sync PTS. - if (mpctx->audio_status == STATUS_EOF && status == AD_OK) { + if (mpctx->audio_status >= STATUS_DRAINING && status == AD_OK) { mpctx->audio_status = STATUS_SYNCING; mpctx->sleeptime = 0; return; // retry on next iteration @@ -449,7 +449,7 @@ void fill_audio_out_buffers(struct MPContext *mpctx, double endpts) } else if (skip < 0) { if (-skip > playsize) { // heuristic against making the buffer too large ao_reset(mpctx->ao); // some AOs repeat data on underflow - mpctx->audio_status = STATUS_EOF; + mpctx->audio_status = STATUS_DRAINING; mpctx->delay = 0; return; } -- cgit v1.2.3