From e13eb3fede680fdadb76efce957806654cda0f23 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 20 Sep 2016 15:34:31 +0200 Subject: command: change update handling of some video-related properties Use the new mechanism, instead of wrapped properties. As usual, extend the update handling to some options that were forgotten/neglected before. Rename video_reset_aspect() to video_reset_params() to make it more "general" (and we can amazingly include write access to video-aspect as well in this). --- options/m_option.h | 3 ++- options/options.c | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'options') diff --git a/options/m_option.h b/options/m_option.h index e0f8979a66..63ba4fac03 100644 --- a/options/m_option.h +++ b/options/m_option.h @@ -386,7 +386,8 @@ struct m_option { #define UPDATE_VIDEOPOS (1 << 9) // video position (panscan etc.) #define UPDATE_OSD (1 << 10) // related to OSD rendering #define UPDATE_BUILTIN_SCRIPTS (1 << 11) // osc/ytdl -#define UPDATE_OPT_LAST (1 << 11) +#define UPDATE_IMGPAR (1 << 12) // video image params overrides +#define UPDATE_OPT_LAST (1 << 12) // All bits between _FIRST and _LAST (inclusive) #define UPDATE_OPTS_MASK \ diff --git a/options/options.c b/options/options.c index 70d921ab73..1476b384b5 100644 --- a/options/options.c +++ b/options/options.c @@ -424,11 +424,11 @@ const m_option_t mp_opts[] = { // -1 means auto aspect (prefer container size until aspect change) // 0 means square pixels - OPT_ASPECT("video-aspect", movie_aspect, 0, -1.0, 10.0), - OPT_CHOICE("video-aspect-method", aspect_method, 0, + OPT_ASPECT("video-aspect", movie_aspect, UPDATE_IMGPAR, -1.0, 10.0), + OPT_CHOICE("video-aspect-method", aspect_method, UPDATE_IMGPAR, ({"hybrid", 0}, {"bitstream", 1}, {"container", 2})), - OPT_CHOICE("field-dominance", field_dominance, 0, + OPT_CHOICE("field-dominance", field_dominance, UPDATE_IMGPAR, ({"auto", -1}, {"top", 0}, {"bottom", 1})), OPT_SUBSTRUCT("vd-lavc", vd_lavc_params, vd_lavc_conf, 0), @@ -531,9 +531,10 @@ const m_option_t mp_opts[] = { OPT_STRING("force-media-title", media_title, 0), // set aspect ratio of monitor - useful for 16:9 TV-out OPT_FLAG("force-rgba-osd-rendering", force_rgba_osd, 0), - OPT_CHOICE_OR_INT("video-rotate", video_rotate, 0, 0, 359, + OPT_CHOICE_OR_INT("video-rotate", video_rotate, UPDATE_IMGPAR, 0, 359, ({"no", -1})), - OPT_CHOICE_C("video-stereo-mode", video_stereo_mode, 0, mp_stereo3d_names), + OPT_CHOICE_C("video-stereo-mode", video_stereo_mode, UPDATE_IMGPAR, + mp_stereo3d_names), OPT_CHOICE_OR_INT("cursor-autohide", cursor_autohide_delay, 0, 0, 30000, ({"no", -1}, {"always", -2})), -- cgit v1.2.3