diff options
author | wm4 <wm4@nowhere> | 2017-12-29 15:39:38 +0100 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-01-02 14:27:37 -0800 |
commit | 3bf7df4a5e1f46248c78e9e596cd8dab6ff57356 (patch) | |
tree | 1b49e9e053e063b397552038c7f3309878d65c86 /sub/sd_lavc.c | |
parent | 828bd2963cd10a851e0a977809687aed4d377dc3 (diff) | |
download | mpv-3bf7df4a5e1f46248c78e9e596cd8dab6ff57356.tar.bz2 mpv-3bf7df4a5e1f46248c78e9e596cd8dab6ff57356.tar.xz |
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.
Diffstat (limited to 'sub/sd_lavc.c')
-rw-r--r-- | sub/sd_lavc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c index e805d5c34c..81d8ccfa7d 100644 --- a/sub/sd_lavc.c +++ b/sub/sd_lavc.c @@ -561,7 +561,7 @@ static double step_sub(struct sd *sd, double now, int movement) movement -= direction; } while (movement); - return best < 0 ? 0 : priv->seekpoints[best].pts - now; + return best < 0 ? now : priv->seekpoints[best].pts; } static int control(struct sd *sd, enum sd_ctrl cmd, void *arg) |