sd_lavc: remove small gaps between subtitles

Just like with text subtitles. Move the magic constants to a common
place too.
This commit is contained in:
wm4
2015-12-05 23:55:56 +01:00
parent 9a240dc82e
commit ff1eaea3e7
3 changed files with 10 additions and 2 deletions

View File

@@ -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;