mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-26 12:50:19 +00:00
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)
This commit is contained in:
11
sub/ass_mp.c
11
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);
|
||||
|
||||
Reference in New Issue
Block a user