From: jstebbins Date: Thu, 4 Dec 2014 20:44:33 +0000 (+0000) Subject: sync: fix a problem with overlapping ssa in mp4 X-Git-Tag: 1.0.0~1711 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a22df485d2ec381edc42492b00b49c72d72c22c;p=handbrake sync: fix a problem with overlapping ssa in mp4 If an SSA starts before and ends after the subsequent SSA, the subtitles were improperly merged resulting in timestamp issues. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6584 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/libhb/sync.c b/libhb/sync.c index f34300750..17d0280e8 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -368,6 +368,17 @@ static hb_buffer_t * mergeSubtitles(subtitle_sanitizer_t *sanitizer, int end) if (ABS(a->s.start - b->s.start) <= 18000) { // subtitles start within 1/5 second of eachother, merge + if (a->s.stop > b->s.stop) + { + // a continues after b, reorder the list and swap + hb_buffer_t *tmp = a; + a->next = b->next; + b->next = a; + a = b; + b = tmp; + sanitizer->list_current = a; + } + sanitizer->list_current = a->next; if (sanitizer->list_current == NULL) sanitizer->last = NULL;