summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-08-27 21:39:59 +0000
committerjstebbins <[email protected]>2014-08-27 21:39:59 +0000
commit5c11601e96ad3c7de0b989d5a34aaafff7530e48 (patch)
tree189eb9809db2ef78acec2ec1aea1807624faaf68 /libhb
parentf96c1c84998a1e13bd37d07f1d33e9b375542f89 (diff)
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
Diffstat (limited to 'libhb')
-rw-r--r--libhb/muxcommon.c14
1 files 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;