summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-12-15 23:54:15 +0000
committerjstebbins <[email protected]>2014-12-15 23:54:15 +0000
commitea449e5b28e4cb5c792e3ed0f7af4e515bb3e206 (patch)
tree2fedfa70b8b8757a3656e588b7dbb51b450fd46c
parent89ee97773c30e7a9ed5b8c8d1eb6a6b24c2c5f9f (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/branches/0.10.x@6601 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/sync.c22
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
{