summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-31 14:47:05 +0200
committerwm4 <wm4@nowhere>2014-08-31 14:48:58 +0200
commitfc0fa9a221882647da563acc2d22eac0f27b1120 (patch)
tree5f2947cecd3453a14b369265bf17f2e36d07446f
parentfd4045965e8926ef994028fffdf7e928038e4714 (diff)
downloadmpv-fc0fa9a221882647da563acc2d22eac0f27b1120.tar.bz2
mpv-fc0fa9a221882647da563acc2d22eac0f27b1120.tar.xz
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).
-rw-r--r--player/audio.c4
1 files changed, 2 insertions, 2 deletions
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;
}