summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-12-04 20:44:33 +0000
committerjstebbins <[email protected]>2014-12-04 20:44:33 +0000
commit9a22df485d2ec381edc42492b00b49c72d72c22c (patch)
tree622d44127a04e8ff18ad0fe42dde4ae54a24006b /libhb
parent0e47f302addb3c331081524b73cc962ce17d7eb6 (diff)
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
Diffstat (limited to 'libhb')
-rw-r--r--libhb/sync.c11
1 files changed, 11 insertions, 0 deletions
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;