diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 94bc6772f2..981a3254a9 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -30,6 +30,7 @@ Interface changes - remove shared-script-properties (user-data is a replacement) - add `--secondary-sub-delay`, decouple secondary subtitles from `--sub-delay` + - add the `--osd-bar-border-size` option --- mpv 0.37.0 --- - `--save-position-on-quit` and its associated commands now store state files in %LOCALAPPDATA% instead of %APPDATA% directory by default on Windows. diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index f80fc77904..45dc0e317f 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -4265,6 +4265,12 @@ OSD ``--osd-bar-h=<0.1-50>`` Height of the OSD bar, in percentage of the screen height (default: 3.125). +``--osd-bar-border-size=`` + Size of the border of the OSD bar in scaled pixels (see ``--sub-font-size`` + for details). + + Default: 1.2. + ``--osd-back-color=`` See ``--sub-color``. Color used for OSD text background. diff --git a/options/options.c b/options/options.c index 526ef7d634..be7d966a95 100644 --- a/options/options.c +++ b/options/options.c @@ -360,6 +360,7 @@ const struct m_sub_options mp_osd_render_sub_opts = { {"osd-bar-align-y", OPT_FLOAT(osd_bar_align_y), M_RANGE(-1.0, +1.0)}, {"osd-bar-w", OPT_FLOAT(osd_bar_w), M_RANGE(1, 100)}, {"osd-bar-h", OPT_FLOAT(osd_bar_h), M_RANGE(0.1, 50)}, + {"osd-bar-border-size", OPT_FLOAT(osd_bar_border_size), M_RANGE(0, 1000.0)}, {"osd", OPT_SUBSTRUCT(osd_style, osd_style_conf)}, {"osd-scale", OPT_FLOAT(osd_scale), M_RANGE(0, 100)}, {"osd-scale-by-window", OPT_BOOL(osd_scale_by_window)}, @@ -371,6 +372,7 @@ const struct m_sub_options mp_osd_render_sub_opts = { .osd_bar_align_y = 0.5, .osd_bar_w = 75.0, .osd_bar_h = 3.125, + .osd_bar_border_size = 1.2, .osd_scale = 1, .osd_scale_by_window = true, }, diff --git a/options/options.h b/options/options.h index 9f55d5b8b1..28a8c90adb 100644 --- a/options/options.h +++ b/options/options.h @@ -135,6 +135,7 @@ struct mp_osd_render_opts { float osd_bar_align_y; float osd_bar_w; float osd_bar_h; + float osd_bar_border_size; float osd_scale; bool osd_scale_by_window; struct osd_style_opts *osd_style; diff --git a/sub/osd_libass.c b/sub/osd_libass.c index a3b19c96df..d5d317d776 100644 --- a/sub/osd_libass.c +++ b/sub/osd_libass.c @@ -378,12 +378,7 @@ static void get_osd_bar_box(struct osd_state *osd, struct osd_object *obj, *o_w = track->PlayResX * (opts->osd_bar_w / 100.0); *o_h = track->PlayResY * (opts->osd_bar_h / 100.0); - float base_size = 0.03125; - style->Outline *= *o_h / track->PlayResY / base_size; - // So that the chapter marks have space between them - style->Outline = MPMIN(style->Outline, *o_h / 5.2); - // So that the border is not 0 - style->Outline = MPMAX(style->Outline, *o_h / 32.0); + style->Outline = opts->osd_bar_border_size; // Rendering with shadow is broken (because there's more than one shape) style->Shadow = 0;