diff options
author | wm4 <wm4@nowhere> | 2017-12-08 11:02:41 +0100 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2017-12-08 20:33:23 +0200 |
commit | 0a749a38f7c5229025efd88318d83767c1458d55 (patch) | |
tree | ae54dbe651e42b2096bdd40065ed1e32bc9180f6 | |
parent | 0f9a690eba9184c8f2c86e4a975612aff49cc9e8 (diff) | |
download | mpv-0a749a38f7c5229025efd88318d83767c1458d55.tar.bz2 mpv-0a749a38f7c5229025efd88318d83767c1458d55.tar.xz |
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.
-rw-r--r-- | player/video.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |