summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-08-30 23:52:16 +0200
committerwm4 <wm4@nowhere>2016-08-30 23:52:16 +0200
commit4d755143216e4d8dec22b4918c1dd290a5efe814 (patch)
tree177ef8dba13d14853fb79175d9dc8370d4823fbd /player/command.c
parentaf1379c43d6a5274b75bce0adeef9e3a9ce87bdf (diff)
downloadmpv-4d755143216e4d8dec22b4918c1dd290a5efe814.tar.bz2
mpv-4d755143216e4d8dec22b4918c1dd290a5efe814.tar.xz
vo: change messy handling of fullscreen and other flags
Before this commit, all VOs had to toggle the option flag themselves, now command.c does it. I can't really comprehend why it required every VO to do this manually. Maybe it was for rejecting the property/option change if the VO didn't support a specific capability. But then it could have checked the VOCTRL result. In any case, I don't care, and successfully changing the property without doing anything (With some VOs) is fine too. Many things work this way now, and it's simpler overall. This change will be useful for cleaning up VO option handling.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/player/command.c b/player/command.c
index a59fa059b8..7a6820af3e 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2352,18 +2352,13 @@ static int panscan_property_helper(void *ctx, struct m_property *prop,
static int mp_property_vo_flag(struct m_property *prop, int action, void *arg,
int vo_ctrl, int *vo_var, MPContext *mpctx)
{
- if (action == M_PROPERTY_SET) {
- int desired = !!*(int *) arg;
- if (*vo_var == desired)
- return M_PROPERTY_OK;
- if (mpctx->video_out) {
+ int old = *vo_var;
+ int res = mp_property_generic_option(mpctx, prop, action, arg);
+ if (action == M_PROPERTY_SET && old != *vo_var) {
+ if (mpctx->video_out)
vo_control(mpctx->video_out, vo_ctrl, 0);
- } else {
- *vo_var = desired;
- }
- return *vo_var == desired ? M_PROPERTY_OK : M_PROPERTY_ERROR;
}
- return mp_property_generic_option(mpctx, prop, action, arg);
+ return res;
}
/// Fullscreen state (RW)