From 43824e793b6d740c5ec266932033b02bc2ea0b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sat, 24 Jan 2026 09:46:15 +0100 Subject: [PATCH] mp_image: call pl_color_space_infer in guess_csp This will do a little bit more than only setting max_luma. Also will fallback to bt.709/bt.1886, but that's fine. We would do it anyway later. If params goes through guess_csp, they shouldn't have "unknown" fields anymore. --- video/mp_image.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/video/mp_image.c b/video/mp_image.c index d1a85e71f2..b289f51cdb 100644 --- a/video/mp_image.c +++ b/video/mp_image.c @@ -1042,12 +1042,7 @@ void mp_image_params_guess_csp(struct mp_image_params *params) // If the signal peak is unknown, we're forced to pick the TRC's // nominal range as the signal peak to prevent clipping - pl_color_space_nominal_luma_ex(pl_nominal_luma_params( - .color = ¶ms->color, - .metadata = PL_HDR_METADATA_HDR10, - .scaling = PL_HDR_NITS, - .out_max = ¶ms->color.hdr.max_luma, - )); + pl_color_space_infer(¶ms->color); if (!pl_color_space_is_hdr(¶ms->color)) { // Some clips have leftover HDR metadata after conversion to SDR, so to