From 75005ec06d13655340439450cd4663bdf7978411 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 22 Aug 2014 14:21:26 +0200 Subject: player: don't clobber playback position on video end If video reaches EOF, and audio is also EOF (or is otherwise not meaningful, like audio disabled), then the playback position was briefly set to 0. Fix this by not trying to use a bogus audio PTS. CC: @mpv-player/stable (maybe) --- player/playloop.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/player/playloop.c b/player/playloop.c index 50494809e3..d7fed6319a 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -860,12 +860,10 @@ void run_playloop(struct MPContext *mpctx) } if (mpctx->video_status == STATUS_EOF && - mpctx->audio_status >= STATUS_PLAYING) + mpctx->audio_status >= STATUS_PLAYING && + mpctx->audio_status < STATUS_EOF) { - double a_pos = 0; - if (mpctx->d_audio) - a_pos = playing_audio_pts(mpctx); - mpctx->playback_pts = a_pos; + mpctx->playback_pts = playing_audio_pts(mpctx); } handle_dummy_ticks(mpctx); -- cgit v1.2.3