diff options
author | wm4 <wm4@nowhere> | 2014-10-17 02:06:08 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-10-17 02:06:08 +0200 |
commit | 41b2927f39f08f54039093746e1d1eded826101e (patch) | |
tree | 0842aa5ab060a50ae14d95851fe5467a2e1aac54 /sub/ass_mp.c | |
parent | ca038d9a228f33bef7420abadce76e9e6f57fbb6 (diff) | |
download | mpv-41b2927f39f08f54039093746e1d1eded826101e.tar.bz2 mpv-41b2927f39f08f54039093746e1d1eded826101e.tar.xz |
sub: adjustments to --ass-style-override option
Now requires newest libass git. Since this feature wasn't part of a
libass release yet, I'm not bothering making the mpv code compatible
with as how it was previously implemented (it will just be disabled
with any older libass).
CC: @mpv-player/stable (because mpv-build uses libass git, and this
breaks the feature)
Diffstat (limited to 'sub/ass_mp.c')
-rw-r--r-- | sub/ass_mp.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sub/ass_mp.c b/sub/ass_mp.c index f5da319730..3140597fd2 100644 --- a/sub/ass_mp.c +++ b/sub/ass_mp.c @@ -136,13 +136,11 @@ void mp_ass_configure(ASS_Renderer *priv, struct MPOpts *opts, float set_line_spacing = 0; float set_font_scale = 1; int set_hinting = 0; - int set_force_override = 0; if (opts->ass_style_override) { set_use_margins = opts->ass_use_margins; set_sub_pos = 100 - opts->sub_pos; set_line_spacing = opts->ass_line_spacing; set_hinting = opts->ass_hinting; - set_force_override = opts->ass_style_override == 3; set_font_scale = opts->sub_scale; if (opts->sub_scale_with_window) { int vidh = dim->h - (dim->mt + dim->mb); @@ -157,8 +155,13 @@ void mp_ass_configure(ASS_Renderer *priv, struct MPOpts *opts, #if LIBASS_VERSION >= 0x01000000 ass_set_shaper(priv, opts->ass_shaper); #endif -#if LIBASS_VERSION >= 0x01103000 - ass_set_selective_style_override_enabled(priv, set_force_override); +#if LIBASS_VERSION >= 0x01103001 + int set_force_flags = 0; + if (opts->ass_style_override == 3) + 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; + ass_set_selective_style_override_enabled(priv, set_force_flags); ASS_Style style = {0}; mp_ass_set_style(&style, 288, opts->sub_text_style); ass_set_selective_style_override(priv, &style); |