diff options
author | wm4 <wm4@nowhere> | 2016-09-18 13:59:46 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-18 16:08:21 +0200 |
commit | 3ecc6d0a7934c42395d863b74e47f903fe864760 (patch) | |
tree | 9f365c372da3dae55e4f5be7706d656b52d590ab | |
parent | 9e972ed7d28c33bf612452682f229fa14ef017ea (diff) | |
download | mpv-3ecc6d0a7934c42395d863b74e47f903fe864760.tar.bz2 mpv-3ecc6d0a7934c42395d863b74e47f903fe864760.tar.xz |
command: fix window-scale option/property inconsistencies
For some odd reason, value ranges for the window-scale option and
property are different, and the property has a more narrow range. Change
it to the option range.
Also store the window-scale value into the option value when setting the
property, so it will be persistent if the window is closed and reopened.
-rw-r--r-- | DOCS/man/input.rst | 3 | ||||
-rw-r--r-- | player/command.c | 11 |
2 files changed, 7 insertions, 7 deletions
diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index e626b1ba81..17bba1c2ab 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -2122,6 +2122,9 @@ caveats with some properties (due to historical reasons): option is for loading playlist during command line parsing. For client API uses, you should use the ``loadlist`` command instead. +``window-scale`` + Might verify the set value when setting while a window is created. + ``audio-file``, ``sub-file``, ``external-file`` These options/properties are actually lists of filenames. To make the command-line interface easier, each ``--audio-file=...`` option appends diff --git a/player/command.c b/player/command.c index 877e0e7e5a..6c5b3e947d 100644 --- a/player/command.c +++ b/player/command.c @@ -2693,7 +2693,10 @@ static int mp_property_window_scale(void *ctx, struct m_property *prop, int s[2] = {vid_w * scale, vid_h * scale}; if (s[0] > 0 && s[1] > 0 && vo_control(vo, VOCTRL_SET_UNFS_WINDOW_SIZE, s) > 0) + { + mpctx->opts->vo->window_scale = scale; return M_PROPERTY_OK; + } return M_PROPERTY_UNAVAILABLE; } case M_PROPERTY_GET: { @@ -2707,13 +2710,7 @@ static int mp_property_window_scale(void *ctx, struct m_property *prop, return M_PROPERTY_OK; } case M_PROPERTY_GET_TYPE: - *(struct m_option *)arg = (struct m_option){ - .type = CONF_TYPE_DOUBLE, - .flags = CONF_RANGE, - .min = 0.125, - .max = 8, - }; - return M_PROPERTY_OK; + return mp_property_generic_option(mpctx, prop, action, arg); } return M_PROPERTY_NOT_IMPLEMENTED; } |