Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DOCS/interface-changes/sub-ass-override-colors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add `--sub-ass-override-colors` option
4 changes: 4 additions & 0 deletions DOCS/man/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2668,6 +2668,10 @@ Subtitles

Default: strip.

``--sub-ass-override-colors<default|no|yes>``
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.
Expand Down
2 changes: 2 additions & 0 deletions options/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)},
Expand Down
1 change: 1 addition & 0 deletions options/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion sub/sd_ass.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,14 +567,15 @@ 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this stay here? For full override?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being able to except colors from sub-ass-override=force was my main point with this so no.

That said i do see how its a mess interface wise that it works independently of sub-ass-override levels i just didn't have a beter idea how to do it.

| ASS_OVERRIDE_BIT_BORDER;
if (!opts->sub_scale_signs)
set_force_flags |= ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE;
#if LIBASS_VERSION >= 0x01703020
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;
Expand Down