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.
This commit is contained in:
wm4 2016-09-18 13:59:46 +02:00
parent 9e972ed7d2
commit 3ecc6d0a79
2 changed files with 7 additions and 7 deletions

View File

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

View File

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