From 41b2927f39f08f54039093746e1d1eded826101e Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 17 Oct 2014 02:06:08 +0200 Subject: 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) --- sub/ass_mp.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sub/ass_mp.c') 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); -- cgit v1.2.3