path: root/player/sub.c
diff options
authorwm4 <wm4@nowhere>2020-02-04 20:26:35 +0100
committerwm4 <wm4@nowhere>2020-02-04 20:26:35 +0100
commit6a83187b064959ca55f14b91446d256c8708970f (patch)
treeb01b90fe2c15b29f1d2ad23460244f3f487dc7e1 /player/sub.c
parent2b851933e013d992069d5a0defce112317ec7625 (diff)
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.)
Diffstat (limited to 'player/sub.c')
1 files changed, 2 insertions, 5 deletions
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);