aboutsummaryrefslogtreecommitdiffhomepage
path: root/player
diff options
context:
space:
mode:
Diffstat (limited to 'player')
-rw-r--r--player/command.c10
-rw-r--r--player/video.c1
2 files changed, 6 insertions, 5 deletions
diff --git a/player/command.c b/player/command.c
index 6dcd200b29..44ffd170a6 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2370,18 +2370,19 @@ static int mp_property_framedrop(void *ctx, struct m_property *prop,
static int mp_property_video_color(void *ctx, struct m_property *prop,
int action, void *arg)
{
+ const char *name = prop->priv ? prop->priv : prop->name;
MPContext *mpctx = ctx;
if (!mpctx->d_video)
return M_PROPERTY_UNAVAILABLE;
switch (action) {
case M_PROPERTY_SET: {
- if (video_set_colors(mpctx->d_video, prop->name, *(int *) arg) <= 0)
+ if (video_set_colors(mpctx->d_video, name, *(int *) arg) <= 0)
return M_PROPERTY_UNAVAILABLE;
break;
}
case M_PROPERTY_GET:
- if (video_get_colors(mpctx->d_video, prop->name, (int *)arg) <= 0)
+ if (video_get_colors(mpctx->d_video, name, (int *)arg) <= 0)
return M_PROPERTY_UNAVAILABLE;
// Write new value to option variable
mp_property_generic_option(mpctx, prop, M_PROPERTY_SET, arg);
@@ -2440,8 +2441,6 @@ static int property_imgparams(struct mp_image_params p, int action, void *arg)
SUB_PROP_STR(m_opt_choice_str(mp_csp_names, p.colorspace))},
{"colorlevels",
SUB_PROP_STR(m_opt_choice_str(mp_csp_levels_names, p.colorlevels))},
- {"outputlevels",
- SUB_PROP_STR(m_opt_choice_str(mp_csp_levels_names, p.outputlevels))},
{"primaries",
SUB_PROP_STR(m_opt_choice_str(mp_csp_prim_names, p.primaries))},
{"gamma",
@@ -3453,6 +3452,8 @@ static const struct m_property mp_properties[] = {
{"contrast", mp_property_video_color},
{"saturation", mp_property_video_color},
{"hue", mp_property_video_color},
+ {"video-output-levels", mp_property_video_color,
+ .priv = (void *)"output-levels"},
{"panscan", panscan_property_helper},
{"video-zoom", panscan_property_helper},
{"video-align-x", panscan_property_helper},
@@ -3563,7 +3564,6 @@ static const struct m_property mp_properties[] = {
M_PROPERTY_ALIAS("sub", "sid"),
M_PROPERTY_ALIAS("colormatrix", "video-params/colormatrix"),
M_PROPERTY_ALIAS("colormatrix-input-range", "video-params/colorlevels"),
- M_PROPERTY_ALIAS("colormatrix-output-range", "video-params/outputlevels"),
M_PROPERTY_ALIAS("colormatrix-primaries", "video-params/primaries"),
M_PROPERTY_ALIAS("colormatrix-gamma", "video-params/gamma"),
diff --git a/player/video.c b/player/video.c
index 97b88de5d2..897c43229e 100644
--- a/player/video.c
+++ b/player/video.c
@@ -787,6 +787,7 @@ static void init_vo(struct MPContext *mpctx)
video_set_colors(d_video, "saturation", opts->gamma_saturation);
if (opts->gamma_hue != 1000)
video_set_colors(d_video, "hue", opts->gamma_hue);
+ video_set_colors(d_video, "output-levels", opts->video_output_levels);
mp_notify(mpctx, MPV_EVENT_VIDEO_RECONFIG, NULL);
}