command: fix or document some property/option consistency issues

Make some existing properties behave more like options. This mostly
means they don't deny access if the associated component is not active,
but redirects to the option.

One kind of fishy change is that we apply --brightness etc. only if
they're not set to the default value. This won't necessarily work with
--vo=xv, but affects only cases where 1. the Xv adapter has been changed
to non-defaults, and 2. the user tries to reset them with mpv by passing
e.g. --brightness=0. We don't care about Xv, and the noted use-case is
dumb, so this change is acceptable.
This commit is contained in:
wm4
2016-09-01 20:57:33 +02:00
parent 192a7344d9
commit 1393d79417
5 changed files with 61 additions and 26 deletions

View File

@@ -962,15 +962,15 @@ static void init_vo(struct MPContext *mpctx)
struct MPOpts *opts = mpctx->opts;
struct vo_chain *vo_c = mpctx->vo_chain;
if (opts->gamma_gamma != 1000)
if (opts->gamma_gamma != 0)
video_set_colors(vo_c, "gamma", opts->gamma_gamma);
if (opts->gamma_brightness != 1000)
if (opts->gamma_brightness != 0)
video_set_colors(vo_c, "brightness", opts->gamma_brightness);
if (opts->gamma_contrast != 1000)
if (opts->gamma_contrast != 0)
video_set_colors(vo_c, "contrast", opts->gamma_contrast);
if (opts->gamma_saturation != 1000)
if (opts->gamma_saturation != 0)
video_set_colors(vo_c, "saturation", opts->gamma_saturation);
if (opts->gamma_hue != 1000)
if (opts->gamma_hue != 0)
video_set_colors(vo_c, "hue", opts->gamma_hue);
video_set_colors(vo_c, "output-levels", opts->video_output_levels);