summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-28 01:37:41 +0100
committerwm4 <wm4@nowhere>2020-02-28 02:14:12 +0100
commitefe43d768fa4dd13329dfa69831aedbdff948718 (patch)
tree2b732385c9ffcd037fdbee6ea5b25416dd590000 /player/loadfile.c
parent009d1ffda6cc5438d7287b2971d17e866ebc86c0 (diff)
downloadmpv-efe43d768fa4dd13329dfa69831aedbdff948718.tar.bz2
mpv-efe43d768fa4dd13329dfa69831aedbdff948718.tar.xz
player: set playback_pts in hr-seek past EOF case
Hr-seek past the last frame instantly enters EOF, which means handle_playback_time() will not set playback_pts to the video PTS (as all video frames are skipped), which leads to the playback time being taken from the last seek target. This results in confusing behavior, especially since the seek time will be clipped to the file duration for display, but not for further relative seeks. Obviously, the time should be set to the last video frame, so use the last video frame as fallback if both audio and video have ended. Also, since the same problem exists with audio-only playback, add a fallback for audio PTS too. We don't know which was the "last" fragment of media played (to decide whether to use the audio or video PTS as the fallback), but it doesn't matter since the maximum works. This could lead to some undesired effects. In particular the audio PTS is basically a bad guess, and is for example not clipped against --end. (But the ridiculous way audio syncing and clamping currently works, I'm not going to touch that shit unless I rewrite it completely.) The cover art case is slightly broken: using --keep-open with keyframe seeks will result in 0 as playback PTS (the video PTS). OK, who cares, it got late. Also casually get rid of last_vo_pts, since that barely made any sense at all. Fixes: #7487
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index 4b71d3a999..0ab79bf7a9 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -1390,7 +1390,6 @@ static void play_current_file(struct MPContext *mpctx)
mpctx->filename = NULL;
mpctx->shown_aframes = 0;
mpctx->shown_vframes = 0;
- mpctx->last_vo_pts = MP_NOPTS_VALUE;
mpctx->last_chapter_seek = -2;
mpctx->last_chapter_pts = MP_NOPTS_VALUE;
mpctx->last_chapter = -2;