diff options
author | wm4 <wm4@nowhere> | 2015-12-05 23:55:56 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-12-05 23:55:56 +0100 |
commit | ff1eaea3e7f9ac2ab45b298326b96d256f487dc3 (patch) | |
tree | 7b0f0f9bcaab6f080b73c11e5318e982d0c8aa42 /sub/sd_lavc.c | |
parent | 9a240dc82e442a2f1d3d383c4b32f3eaab0a1f6a (diff) | |
download | mpv-ff1eaea3e7f9ac2ab45b298326b96d256f487dc3.tar.bz2 mpv-ff1eaea3e7f9ac2ab45b298326b96d256f487dc3.tar.xz |
sd_lavc: remove small gaps between subtitles
Just like with text subtitles. Move the magic constants to a common
place too.
Diffstat (limited to 'sub/sd_lavc.c')
-rw-r--r-- | sub/sd_lavc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c index d6f6bf8e48..563ac554fc 100644 --- a/sub/sd_lavc.c +++ b/sub/sd_lavc.c @@ -202,6 +202,9 @@ static void decode(struct sd *sd, struct demux_packet *packet) if (prev->endpts == MP_NOPTS_VALUE || prev->endpts > pts) prev->endpts = pts; + if (opts->sub_fix_timing && pts - prev->endpts <= SUB_GAP_THRESHOLD) + prev->endpts = pts; + for (int n = 0; n < priv->num_seekpoints; n++) { if (priv->seekpoints[n].pts == prev->pts) { priv->seekpoints[n].endpts = prev->endpts; |