summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-24 11:39:19 +0100
committerwm4 <wm4@nowhere>2015-02-24 11:39:25 +0100
commitb629da9a40673ccd67bf7661cfdd10c8f79f6eaa (patch)
tree3db2ac3b6c5c5a5c7685929d2ac177f35a46560b
parent7cff2e41316d508754b7b0725f5236de180f5cc2 (diff)
downloadmpv-b629da9a40673ccd67bf7661cfdd10c8f79f6eaa.tar.bz2
mpv-b629da9a40673ccd67bf7661cfdd10c8f79f6eaa.tar.xz
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.
-rw-r--r--sub/ass_mp.c4
1 files changed, 3 insertions, 1 deletions
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;