summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-11-18 13:01:46 +0100
committerwm4 <wm4@nowhere>2016-11-18 13:02:03 +0100
commitc4d6fcbb021a3e3d0c62d6f60ec88aaea602b054 (patch)
tree9ab7d197e1a3f1f4650317a6a6224c7171a89a69
parent6250007bcaf1ca780aea033d2bb795aa12cc1ed6 (diff)
downloadmpv-c4d6fcbb021a3e3d0c62d6f60ec88aaea602b054.tar.bz2
mpv-c4d6fcbb021a3e3d0c62d6f60ec88aaea602b054.tar.xz
player: make sure non-video subtitle rendering is reset if video resumes
If video reaches EOF, subtitle timing will be switched to timing without video frames. This means it calls osd_set_force_video_pts() and overrides the PTS of whatever video frame is current (since the video frame's PTS has nothing to do with the current playback position anymore). This was not reset when seeking back into video. Subtitles wouldn't show up, or if there was a subtitle displayed, it would get stuck with it. In particular, this could happen even if EOF was only temporary (such as with --keep-open). Fix this by clearing the override PTS whenever a video frame is shown. Fixes #3770.
-rw-r--r--player/video.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/player/video.c b/player/video.c
index 7a76f4dc8e..847a5b56d9 100644
--- a/player/video.c
+++ b/player/video.c
@@ -482,9 +482,6 @@ int reinit_video_chain_src(struct MPContext *mpctx, struct lavfi_pad *src)
update_window_title(mpctx, true);
- // Undo what the subtitle path does if mpctx->vo_chain is unset.
- osd_set_force_video_pts(mpctx->osd, MP_NOPTS_VALUE);
-
struct vo_chain *vo_c = talloc_zero(NULL, struct vo_chain);
mpctx->vo_chain = vo_c;
vo_c->log = mpctx->log;
@@ -1427,6 +1424,9 @@ void write_video(struct MPContext *mpctx)
mpctx->time_frame -= get_relative_time(mpctx);
update_avsync_before_frame(mpctx);
+ // Enforce timing subtitles to video frames.
+ osd_set_force_video_pts(mpctx->osd, MP_NOPTS_VALUE);
+
if (!update_subtitles(mpctx, mpctx->next_frames[0]->pts)) {
MP_VERBOSE(mpctx, "Video frame delayed due waiting on subtitles.\n");
return;