From 84f6d7a97eda8a303cfbb4553fa736c67c19280d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Wed, 22 Feb 2023 22:10:55 +0100 Subject: [PATCH] vo_gpu_next: fix color space hint with target peak override Fixes: #11339 --- video/out/vo_gpu_next.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 060b17a80b..fee22e5141 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -819,7 +819,8 @@ static void apply_target_options(struct priv *p, struct pl_frame *target) target->color.primaries = mp_prim_to_pl(opts->target_prim); if (opts->target_trc) target->color.transfer = mp_trc_to_pl(opts->target_trc); - if (opts->target_peak) + // If swapchain returned a value use this, override is used in hint + if (opts->target_peak && !target->color.hdr.max_luma) target->color.hdr.max_luma = opts->target_peak; if (opts->dither_depth > 0) { struct pl_bit_encoding *tbits = &target->repr.bits; @@ -895,6 +896,8 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame) hint.primaries = mp_prim_to_pl(opts->target_prim); if (opts->target_trc) hint.transfer = mp_trc_to_pl(opts->target_trc); + if (opts->target_peak) + hint.hdr.max_luma = opts->target_peak; pl_swapchain_colorspace_hint(p->sw, &hint); } else if (!p->target_hint) { pl_swapchain_colorspace_hint(p->sw, NULL);