From 0a749a38f7c5229025efd88318d83767c1458d55 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 8 Dec 2017 11:02:41 +0100 Subject: video: add a shitty hack to avoid missing subtitles with vf_sub update_subtitles() makes sure all subtitle packets at/before the given PTS have been read and processed. Normally, this function is only called before sending a frame to the VO. This is too late for vf_sub, which expects the subtitles to be updated before feeding a frame to the filters. Apparently this was specifically a problem for the first frame. Subsequent frames might have been ok due to general prefetching. (This will fail anyway, should a filter dare to add an offset to the timestamps of the filered frames before they pass to vf_sub.) Fixes #5194. --- player/video.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/player/video.c b/player/video.c index 75ab78d5ab..634eee0f86 100644 --- a/player/video.c +++ b/player/video.c @@ -553,6 +553,8 @@ static int video_filter(struct MPContext *mpctx, bool eof) // If something was decoded, and the filter chain is ready, filter it. if (!need_vf_reconfig && vo_c->input_mpi) { + if (osd_get_render_subs_in_filter(mpctx->osd)) + update_subtitles(mpctx, vo_c->input_mpi->pts); vf_filter_frame(vf, vo_c->input_mpi); vo_c->input_mpi = NULL; return VD_PROGRESS; -- cgit v1.2.3