mirror of
https://github.com/mpv-player/mpv
synced 2025-02-03 13:41:49 +00:00
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:
parent
0f9a690eba
commit
0a749a38f7
@ -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 something was decoded, and the filter chain is ready, filter it.
|
||||||
if (!need_vf_reconfig && vo_c->input_mpi) {
|
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);
|
vf_filter_frame(vf, vo_c->input_mpi);
|
||||||
vo_c->input_mpi = NULL;
|
vo_c->input_mpi = NULL;
|
||||||
return VD_PROGRESS;
|
return VD_PROGRESS;
|
||||||
|
Loading…
Reference in New Issue
Block a user