From ff1eaea3e7f9ac2ab45b298326b96d256f487dc3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 5 Dec 2015 23:55:56 +0100 Subject: sd_lavc: remove small gaps between subtitles Just like with text subtitles. Move the magic constants to a common place too. --- sub/sd_lavc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sub/sd_lavc.c') 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; -- cgit v1.2.3