diff options
author | jstebbins <[email protected]> | 2014-12-15 23:51:47 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2014-12-15 23:51:47 +0000 |
commit | d0a975e42dcab93e1d2eead350fb1ba3951d977c (patch) | |
tree | f033d43fc6373ed19024ec429c911dce4fa62077 | |
parent | fa74388f8e5a42a400daba5ecff61e856d04e6c2 (diff) |
sync: fix another issue with overlapping ssa subtitle translation to tx3g
It was failing if 3 or more subtitles overlapped simultaneously.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6600 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | libhb/sync.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/libhb/sync.c b/libhb/sync.c index 575e079ae..5f7cbd4e6 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -383,23 +383,31 @@ static hb_buffer_t * mergeSubtitles(subtitle_sanitizer_t *sanitizer, int end) sanitizer->list_current = a; } - sanitizer->list_current = a->next; - if (sanitizer->list_current == NULL) - sanitizer->last = NULL; a->next = NULL; b->s.start = a->s.stop; buf = merge_ssa(a, b); hb_buffer_close(&a); + a = buf; + buf = NULL; + sanitizer->list_current = a; - if (b->s.stop != AV_NOPTS_VALUE && ABS(b->s.stop - b->s.start) <= 18000) + if (b->s.stop != AV_NOPTS_VALUE && + ABS(b->s.stop - b->s.start) <= 18000) { // b and a completely overlap, remove b - sanitizer->list_current = b->next; - if (sanitizer->list_current == NULL) - sanitizer->last = NULL; + a->next = b->next; + b->next = NULL; + if (sanitizer->last == b) + { + sanitizer->last = a; + } hb_buffer_close(&b); } + else + { + a->next = b; + } } else { |