From b629da9a40673ccd67bf7661cfdd10c8f79f6eaa Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 24 Feb 2015 11:39:19 +0100 Subject: sub: apply text subtitle style overrides more eagerly Basically abuse the style override mechanism meant for ASS (mp_ass_set_style()) to update text subtitle styling at runtime too. This even has the advantage that the style will be overridden, even if the text subtitle converted (like sd_lavc_conv.c) dares to add a fixed style in the styles section. Probably helps with #1622. --- sub/ass_mp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sub/ass_mp.c b/sub/ass_mp.c index 5234cc85d6..be8afe374d 100644 --- a/sub/ass_mp.c +++ b/sub/ass_mp.c @@ -126,11 +126,13 @@ void mp_ass_configure(ASS_Renderer *priv, struct MPOpts *opts, bool is_ass, int set_hinting = 0; bool set_scale_with_window = false; bool set_scale_by_window = true; + bool total_override = false; // With forced overrides, apply the --sub-* specific options if (!is_ass || opts->ass_style_override == 3) { set_scale_with_window = opts->sub_scale_with_window; set_use_margins = opts->sub_use_margins; set_scale_by_window = opts->sub_scale_by_window; + total_override = true; } else { set_scale_with_window = opts->ass_scale_with_window; set_use_margins = opts->ass_use_margins; @@ -154,7 +156,7 @@ void mp_ass_configure(ASS_Renderer *priv, struct MPOpts *opts, bool is_ass, ass_set_line_position(priv, set_sub_pos); ass_set_shaper(priv, opts->ass_shaper); int set_force_flags = 0; - if (opts->ass_style_override == 3) + if (total_override) set_force_flags |= ASS_OVERRIDE_BIT_STYLE | ASS_OVERRIDE_BIT_FONT_SIZE; if (opts->ass_style_override == 4) set_force_flags |= ASS_OVERRIDE_BIT_FONT_SIZE; -- cgit v1.2.3