From 90b968a67a73473d615e2ee6135756573d0da6f2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 26 Oct 2016 20:43:03 +0200 Subject: player: show subtitles on VO if --force-window is used If a VO is created, but no video is playing (i.e. --force-window is used), then until now no subtitles were shown. This is because VO subtitle display normally depends on video frame timing. If there are no video frames, there can be no subtitles. Change this and add some code to handle this situation specifically. Set a subtitle PTS manually and request VO redrawing manually, which gets the subtitles rendered somehow. This is kind of shaky. The subtitles are essentially sampled at arbitrary times (such as when new audio data is decoded and pushed to the AO, or on user interaction). To make a it slightly more consistent, force a completely arbitrary minimum FPS of 10. Other solutions (such as creating fake video) would be more intrusive or would require VO-level API changes. Fixes #3684. --- player/video.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'player/video.c') diff --git a/player/video.c b/player/video.c index 21babe016e..7a76f4dc8e 100644 --- a/player/video.c +++ b/player/video.c @@ -482,6 +482,9 @@ 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; -- cgit v1.2.3