options: rename --sub-ass-force-style to --sub-ass-style-overrides

This option has exactly the same semantics are other mpv options that
override a particular thing with something from the user. So instead of
the "force-style" name, use "-overrides" which is more consistent.
The plural form is used since it's a list option.
This commit is contained in:
Dudemanguy 2023-10-15 10:28:40 -05:00
parent 9924102c66
commit b626f3ba83
5 changed files with 11 additions and 9 deletions

View File

@ -103,6 +103,7 @@ Interface changes
- disable `--allow-delayed-peak-detect` by default
- rename `--fps` to `--container-fps-override`
- rename `--override-display-fps` to `--display-fps-override`
- rename `--sub-ass-force-style` to `--sub-ass-style-overrides`
--- mpv 0.36.0 ---
- add `--target-contrast`
- Target luminance value is now also applied when ICC profile is used.

View File

@ -2399,15 +2399,15 @@ Subtitles
``--sub-speed=25/23.976`` plays frame based subtitles which have been
loaded assuming a framerate of 23.976 at 25 FPS.
``--sub-ass-force-style=<[Style.]Param=Value[,...]>``
``--sub-ass-style-overrides=<[Style.]Param=Value[,...]>``
Override some style or script info parameters.
This is a string list option. See `List Options`_ for details.
.. admonition:: Examples
- ``--sub-ass-force-style=FontName=Arial,Default.Bold=1``
- ``--sub-ass-force-style=PlayResY=768``
- ``--sub-ass-style-overrides=FontName=Arial,Default.Bold=1``
- ``--sub-ass-style-overrides=PlayResY=768``
.. note::

View File

@ -305,7 +305,7 @@ const struct m_sub_options mp_subtitle_sub_opts = {
{"no", 0}, {"basic", 1}, {"full", 2}, {"force-601", 3})},
{"sub-ass-vsfilter-blur-compat", OPT_BOOL(ass_vsfilter_blur_compat)},
{"embeddedfonts", OPT_BOOL(use_embedded_fonts), .flags = UPDATE_SUB_HARD},
{"sub-ass-force-style", OPT_STRINGLIST(ass_force_style_list),
{"sub-ass-style-overrides", OPT_STRINGLIST(ass_style_override_list),
.flags = UPDATE_SUB_HARD},
{"sub-ass-styles", OPT_STRING(ass_styles_file),
.flags = M_OPT_FILE | UPDATE_SUB_HARD},
@ -323,6 +323,7 @@ const struct m_sub_options mp_subtitle_sub_opts = {
{"sub-clear-on-seek", OPT_BOOL(sub_clear_on_seek)},
{"teletext-page", OPT_INT(teletext_page), M_RANGE(1, 999)},
{"sub-past-video-end", OPT_BOOL(sub_past_video_end)},
{"sub-ass-force-style", OPT_REPLACED("sub-ass-style-overrides")},
{0}
},
.size = sizeof(OPT_BASE_STRUCT),

View File

@ -108,7 +108,7 @@ struct mp_subtitle_opts {
int ass_vsfilter_color_compat;
bool ass_vsfilter_blur_compat;
bool use_embedded_fonts;
char **ass_force_style_list;
char **ass_style_override_list;
char *ass_styles_file;
int ass_style_override;
int ass_hinting;

View File

@ -214,7 +214,7 @@ static void assobjects_init(struct sd *sd)
add_subtitle_fonts(sd);
if (opts->ass_style_override)
ass_set_style_overrides(ctx->ass_library, opts->ass_force_style_list);
ass_set_style_overrides(ctx->ass_library, opts->ass_style_override_list);
ctx->ass_track = ass_new_track(ctx->ass_library);
ctx->ass_track->track_type = TRACK_TYPE_ASS;
@ -452,9 +452,9 @@ static void configure_ass(struct sd *sd, struct mp_osd_res *dim,
#endif
if (converted) {
bool override_playres = true;
char **ass_force_style_list = opts->ass_force_style_list;
for (int i = 0; ass_force_style_list && ass_force_style_list[i]; i++) {
if (bstr_find0(bstr0(ass_force_style_list[i]), "PlayResX") >= 0)
char **ass_style_override_list = opts->ass_style_override_list;
for (int i = 0; ass_style_override_list && ass_style_override_list[i]; i++) {
if (bstr_find0(bstr0(ass_style_override_list[i]), "PlayResX") >= 0)
override_playres = false;
}