From 6a83187b064959ca55f14b91446d256c8708970f Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 4 Feb 2020 20:26:35 +0100 Subject: player: partially fix backward playback display of cached text subtitles This simply didn't set the direction flag in most situations, which meant the timestamps used in the subtitle renderer were nonsense, leading to invisible subtitles. This works only for text subtitles that are cached in the ASS_Track state. Reading new subtitles is broken because the demuxer layer has trouble returning subtitle packets backwards, and I think for rendering bitmap subtitles, the pruning direction would have to be adjusted. (Not sure if reversing the timestamps before the subtitle renderer backend is even the right thing to do. At least for sd_ass.c, it seems to make sense, because it caches subtitles with "normal" timestamps.) --- player/sub.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'player/sub.c') diff --git a/player/sub.c b/player/sub.c index 12a9696227..599430ac21 100644 --- a/player/sub.c +++ b/player/sub.c @@ -57,11 +57,8 @@ static void reset_subtitles(struct MPContext *mpctx, struct track *track) void reset_subtitle_state(struct MPContext *mpctx) { - for (int n = 0; n < mpctx->num_tracks; n++) { - struct dec_sub *d_sub = mpctx->tracks[n]->d_sub; - if (d_sub) - sub_reset(d_sub); - } + for (int n = 0; n < mpctx->num_tracks; n++) + reset_subtitles(mpctx, mpctx->tracks[n]); term_osd_set_subs(mpctx, NULL); } -- cgit v1.2.3