diff options
-rw-r--r-- | DOCS/man/options.rst | 7 | ||||
-rw-r--r-- | options/options.c | 2 | ||||
-rw-r--r-- | options/options.h | 1 | ||||
-rw-r--r-- | video/out/w32_common.c | 4 | ||||
-rw-r--r-- | video/out/x11_common.c | 2 |
5 files changed, 13 insertions, 3 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 69525aee66..0b6d16127b 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -1666,6 +1666,13 @@ Window disable the window manager hints that force the window aspect ratio. (Ignored in fullscreen mode.) +``--no-keepaspect-window``, ``--keepaspect-window`` + ``--keepaspect-window`` (the default) will lock the window size to the + video aspect. ``--no-keepaspect-window`` disables this behavior, and will + instead add black bars if window aspect and video aspect mismatch. Whether + this actually works depends on the VO backend. + (Ignored in fullscreen mode.) + ``--monitoraspect=<ratio>`` Set the aspect ratio of your monitor or TV screen. A value of 0 disables a previous setting (e.g. in the config file). Overrides the diff --git a/options/options.c b/options/options.c index 1639719dfe..a6cb4eb45f 100644 --- a/options/options.c +++ b/options/options.c @@ -453,6 +453,7 @@ const m_option_t mp_opts[] = { OPT_INTRANGE("hue", gamma_hue, 0, -100, 100), OPT_INTRANGE("gamma", gamma_gamma, 0, -100, 100), OPT_FLAG("keepaspect", vo.keepaspect, 0), + OPT_FLAG("keepaspect-window", vo.keepaspect_window, 0), //---------------------- mplayer-only options ------------------------ @@ -572,6 +573,7 @@ const struct MPOpts mp_default_opts = { .fsscreen_id = -1, .panscan = 0.0f, .keepaspect = 1, + .keepaspect_window = 1, .border = 1, .WinID = -1, }, diff --git a/options/options.h b/options/options.h index 580a0cc780..8d0b694d98 100644 --- a/options/options.h +++ b/options/options.h @@ -27,6 +27,7 @@ typedef struct mp_vo_opts { struct m_geometry autofit_larger; int keepaspect; + int keepaspect_window; int border; int64_t WinID; diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 3fcfc6d969..addc46bf0e 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -551,8 +551,8 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, break; } case WM_SIZING: - if (w32->opts->keepaspect && !w32->opts->fullscreen && - w32->opts->WinID < 0) + if (w32->opts->keepaspect && w32->opts->keepaspect_window && + !w32->opts->fullscreen && w32->opts->WinID < 0) { RECT *rc = (RECT*)lParam; // get client area of the windows if it had the rect rc diff --git a/video/out/x11_common.c b/video/out/x11_common.c index aed54f9010..b094364a6e 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -999,7 +999,7 @@ static void vo_x11_sizehint(struct vo *vo, struct mp_rect rc, bool override_pos) hint->max_width = 0; hint->max_height = 0; - if (opts->keepaspect) { + if (opts->keepaspect && opts->keepaspect_window) { hint->flags |= PAspect; hint->min_aspect.x = hint->width; hint->min_aspect.y = hint->height; |