From 3ecc6d0a7934c42395d863b74e47f903fe864760 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 18 Sep 2016 13:59:46 +0200 Subject: 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. --- player/command.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'player') 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; } -- cgit v1.2.3