From 699c880ff6f7e48aa4cd040aba8adc0fb4b4a6ce Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Wed, 24 Jan 2024 11:34:35 +0100 Subject: [PATCH] dectx3gsub: properly increment the line count, each SSA line in MKV (and in libass) requires an unique ReadOrder number. Fix a regression introduced in c72bb7d that was breaking burned subtitles and the creation of incorrect MKV files when the source subtitles were in the tx3g format. --- libhb/dectx3gsub.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libhb/dectx3gsub.c b/libhb/dectx3gsub.c index 43d3b6469b37..7848417b6739 100644 --- a/libhb/dectx3gsub.c +++ b/libhb/dectx3gsub.c @@ -169,7 +169,7 @@ static hb_buffer_t *tx3g_decode_to_ssa(hb_work_private_t *pv, hb_buffer_t *in) int charIndex = 0; int styleIndex = 0; - snprintf((char*)dst, maxOutputSize, "%d,,Default,,0,0,0,,", pv->line); + snprintf((char*)dst, maxOutputSize, "%d,0,Default,,0,0,0,,", pv->line); dst += strlen((char*)dst); start = dst; for (pos = text, end = text + textLength; pos < end; pos++) @@ -219,6 +219,8 @@ static hb_buffer_t *tx3g_decode_to_ssa(hb_work_private_t *pv, hb_buffer_t *in) *dst = '\0'; dst++; + pv->line++; + // Trim output buffer to the actual amount of data written out->size = dst - out->data;