From 32ee937afaef71e789f4bdebb7cd122b44a75919 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 21 Aug 2023 19:49:27 +0200 Subject: [PATCH] vo_gpu_next: correctly handle GAMUT_AUTO Fixes: https://github.com/mpv-player/mpv/issues/12208 --- video/out/vo_gpu_next.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 2ad4902aac..6dbfb48ed5 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -1984,7 +1984,8 @@ static void update_render_options(struct vo *vo) [TONE_MAPPING_ST2094_10] = &pl_tone_map_st2094_10, }; - const struct pl_gamut_map_function *gamut_modes[] = { + const struct pl_gamut_map_function * const gamut_modes[] = { + [GAMUT_AUTO] = pl_color_map_default_params.gamut_mapping, [GAMUT_CLIP] = &pl_gamut_map_clip, [GAMUT_PERCEPTUAL] = &pl_gamut_map_perceptual, [GAMUT_RELATIVE] = &pl_gamut_map_relative, @@ -2004,8 +2005,7 @@ static void update_render_options(struct vo *vo) pars->color_map_params.contrast_recovery = opts->tone_map.contrast_recovery; pars->color_map_params.visualize_lut = opts->tone_map.visualize; pars->color_map_params.contrast_smoothness = opts->tone_map.contrast_smoothness; - if (opts->tone_map.gamut_mode != GAMUT_AUTO) - pars->color_map_params.gamut_mapping = gamut_modes[opts->tone_map.gamut_mode]; + pars->color_map_params.gamut_mapping = gamut_modes[opts->tone_map.gamut_mode]; switch (opts->dither_algo) { case DITHER_NONE: