0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

options: add --no-keepaspect-window

Seems silly, but was requested.
This commit is contained in:
wm4 2014-10-04 22:17:36 +02:00
parent 1651d96583
commit bd169a313c
5 changed files with 13 additions and 3 deletions

View File

@ -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

View File

@ -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,
},

View File

@ -27,6 +27,7 @@ typedef struct mp_vo_opts {
struct m_geometry autofit_larger;
int keepaspect;
int keepaspect_window;
int border;
int64_t WinID;

View File

@ -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

View File

@ -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;