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.
This commit is contained in:
wm4 2017-12-08 11:02:41 +01:00 committed by Jan Ekström
parent 0f9a690eba
commit 0a749a38f7
1 changed files with 2 additions and 0 deletions

View File

@ -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;