diff --git a/DOCS/interface-changes/sub-ass-override-colors.txt b/DOCS/interface-changes/sub-ass-override-colors.txt new file mode 100644 index 0000000000000..046a531cf0ab5 --- /dev/null +++ b/DOCS/interface-changes/sub-ass-override-colors.txt @@ -0,0 +1 @@ +add `--sub-ass-override-colors` option diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 7471eda757813..ce610d4f701ca 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -2668,6 +2668,10 @@ Subtitles Default: strip. +``--sub-ass-override-colors`` + Toggle for overriding of ass subtitle dialogue colors. + When set to default this option is enabled when ``--sub-ass-override`` is higher than ``force``. + ``--sub-ass-force-margins`` Enables placing toptitles and subtitles in black borders when they are available, if the subtitles are in the ASS format. diff --git a/options/options.c b/options/options.c index f25d435950142..cea9a342759aa 100644 --- a/options/options.c +++ b/options/options.c @@ -329,6 +329,8 @@ const struct m_sub_options mp_subtitle_sub_opts = { {"sub-ass-shaper", OPT_REPLACED("sub-shaper")}, {"sub-ass-prune-delay", OPT_DOUBLE(ass_prune_delay), M_RANGE(-1.0, 10000.0)}, {"sub-ass-justify", OPT_BOOL(ass_justify)}, + {"sub-ass-override-colors", OPT_CHOICE(ass_override_colors, + {"default", 0}, {"no", 1}, {"yes", 2})}, {"sub-scale-by-window", OPT_BOOL(sub_scale_by_window)}, {"sub-scale-with-window", OPT_BOOL(sub_scale_with_window)}, {"sub-ass-scale-with-window", OPT_BOOL(ass_scale_with_window)}, diff --git a/options/options.h b/options/options.h index 6f16f50c25ecf..17c8d70faf6ce 100644 --- a/options/options.h +++ b/options/options.h @@ -124,6 +124,7 @@ struct mp_subtitle_opts { int sub_shaper; double ass_prune_delay; bool ass_justify; + int ass_override_colors; bool sub_clear_on_seek; int teletext_page; bool sub_past_video_end; diff --git a/sub/sd_ass.c b/sub/sd_ass.c index 15d4db7d0bc40..dcb7bc8cd6910 100644 --- a/sub/sd_ass.c +++ b/sub/sd_ass.c @@ -567,7 +567,6 @@ static void configure_ass(struct sd *sd, struct mp_osd_res *dim, if (total_override) { set_force_flags |= ASS_OVERRIDE_BIT_FONT_NAME | ASS_OVERRIDE_BIT_FONT_SIZE_FIELDS - | ASS_OVERRIDE_BIT_COLORS | ASS_OVERRIDE_BIT_BORDER; if (!opts->sub_scale_signs) set_force_flags |= ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE; @@ -575,6 +574,8 @@ static void configure_ass(struct sd *sd, struct mp_osd_res *dim, set_force_flags |= ASS_OVERRIDE_BIT_BLUR; #endif } + if ((opts->ass_override_colors == 0 && total_override) || opts->ass_override_colors == 2) + set_force_flags |= ASS_OVERRIDE_BIT_COLORS; if (shared_opts->ass_style_override[sd->order] == ASS_STYLE_OVERRIDE_SCALE && !opts->sub_scale_signs) set_force_flags |= ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE;