From 3bf7df4a5e1f46248c78e9e596cd8dab6ff57356 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 29 Dec 2017 15:39:38 +0100 Subject: sub: move all subtitle timestamp messing code to a central place It was split at least across osd.c and sd_ass.c/sd_lavc.c. sd_lavc.c actually ignored most of the more obscure subtitle timing things. There's no reason for this - just move it all to dec_sub.c (mostly from sd_ass.c, because it has some of the most complex stuff). Now timestamps are transformed as they enter or leave dec_sub.c. There appear to have been some subtle mismatches about how subtitle timestamps were transformed, e.g. sd_functions.accepts_packet didn't apply the subtitle speed to the timestamp. This patch should fix them, although it's not clear if they caused actual misbehavior. The semantics of SD_CTRL_SUB_STEP are slightly changed, which is the reason for the changes in command.c and sd_lavc.c. --- player/sub.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'player/sub.c') diff --git a/player/sub.c b/player/sub.c index 2702e7bf55..0de02ea61b 100644 --- a/player/sub.c +++ b/player/sub.c @@ -84,7 +84,6 @@ void uninit_sub_all(struct MPContext *mpctx) static bool update_subtitle(struct MPContext *mpctx, double video_pts, struct track *track) { - struct MPOpts *opts = mpctx->opts; struct dec_sub *dec_sub = track ? track->d_sub : NULL; if (!dec_sub || video_pts == MP_NOPTS_VALUE) @@ -96,8 +95,6 @@ static bool update_subtitle(struct MPContext *mpctx, double video_pts, sub_control(dec_sub, SD_CTRL_SET_VIDEO_PARAMS, ¶ms); } - video_pts -= opts->sub_delay; - if (track->demuxer->fully_read && sub_can_preload(dec_sub)) { // Assume fully_read implies no interleaved audio/video streams. // (Reading packets will change the demuxer position.) -- cgit v1.2.3