From 4d755143216e4d8dec22b4918c1dd290a5efe814 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 30 Aug 2016 23:52:16 +0200 Subject: 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. --- player/command.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'player/command.c') 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) -- cgit v1.2.3