From 5c11601e96ad3c7de0b989d5a34aaafff7530e48 Mon Sep 17 00:00:00 2001 From: jstebbins Date: Wed, 27 Aug 2014 21:39:59 +0000 Subject: libhb: fix tx3g styles when the entire line is one style the style was not getting flushed if there were no style changes git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6375 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/muxcommon.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libhb/muxcommon.c b/libhb/muxcommon.c index d1646e7fb..a555f95c4 100644 --- a/libhb/muxcommon.c +++ b/libhb/muxcommon.c @@ -751,10 +751,15 @@ static void update_style(style_context_t *ctx, ctx->current_style.fg_alpha != style->fg_alpha) { update_style_atoms(ctx, pos - 1); + ctx->current_style = *style; + ctx->style_start = pos; } } - ctx->current_style = *style; - ctx->style_start = pos; + else + { + ctx->current_style = *style; + ctx->style_start = pos; + } } static void style_context_init(style_context_t *ctx, uint8_t *style_atoms) @@ -831,6 +836,11 @@ void hb_muxmp4_process_subtitle_style(uint8_t *input, in_pos += consumed; update_style(&ctx, &style, out_pos - utf8_count); } + // Return to default style at end of line, flushes any pending + // style changes + hb_ssa_style_init(&style); + update_style(&ctx, &style, out_pos - utf8_count); + // null terminate output string output[out_pos] = 0; -- cgit v1.2.3