Skip to content

Commit 2e8758d

Browse files
committed
sub/sd_ass: add separate option for ass sub color override
Previusly this flag was turned on with sub-ass-override >= force. This commit makes it an independent option.
1 parent a043624 commit 2e8758d

5 files changed

Lines changed: 12 additions & 1 deletion

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add `--sub-ass-override-colors` option

DOCS/man/options.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,6 +2668,12 @@ Subtitles
26682668

26692669
Default: strip.
26702670

2671+
``--sub-ass-override-colors``
2672+
Enables overriding ass subtitle dialogue colors with the user default ones
2673+
(defined with ``--sub-color`` / ``--sub-outline-color``).
2674+
2675+
Default: no.
2676+
26712677
``--sub-ass-force-margins``
26722678
Enables placing toptitles and subtitles in black borders when they are
26732679
available, if the subtitles are in the ASS format.

options/options.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ const struct m_sub_options mp_subtitle_sub_opts = {
329329
{"sub-ass-shaper", OPT_REPLACED("sub-shaper")},
330330
{"sub-ass-prune-delay", OPT_DOUBLE(ass_prune_delay), M_RANGE(-1.0, 10000.0)},
331331
{"sub-ass-justify", OPT_BOOL(ass_justify)},
332+
{"sub-ass-override-colors", OPT_BOOL(ass_override_colors)},
332333
{"sub-scale-by-window", OPT_BOOL(sub_scale_by_window)},
333334
{"sub-scale-with-window", OPT_BOOL(sub_scale_with_window)},
334335
{"sub-ass-scale-with-window", OPT_BOOL(ass_scale_with_window)},

options/options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ struct mp_subtitle_opts {
124124
int sub_shaper;
125125
double ass_prune_delay;
126126
bool ass_justify;
127+
bool ass_override_colors;
127128
bool sub_clear_on_seek;
128129
int teletext_page;
129130
bool sub_past_video_end;

sub/sd_ass.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@ static void configure_ass(struct sd *sd, struct mp_osd_res *dim,
567567
if (total_override) {
568568
set_force_flags |= ASS_OVERRIDE_BIT_FONT_NAME
569569
| ASS_OVERRIDE_BIT_FONT_SIZE_FIELDS
570-
| ASS_OVERRIDE_BIT_COLORS
571570
| ASS_OVERRIDE_BIT_BORDER;
572571
if (!opts->sub_scale_signs)
573572
set_force_flags |= ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE;
@@ -584,6 +583,9 @@ static void configure_ass(struct sd *sd, struct mp_osd_res *dim,
584583
if ((converted || shared_opts->ass_style_override[sd->order]) && opts->ass_justify)
585584
set_force_flags |= ASS_OVERRIDE_BIT_JUSTIFY;
586585
#endif
586+
if (opts->ass_override_colors)
587+
set_force_flags |= ASS_OVERRIDE_BIT_COLORS;
588+
587589
ass_set_selective_style_override_enabled(priv, set_force_flags);
588590
ASS_Style style = {0};
589591
mp_ass_set_style(&style, MP_ASS_FONT_PLAYRESY, opts->sub_style);

0 commit comments

Comments
 (0)