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.
This commit is contained in:
Kacper Michajłow committed 2026-01-24 14:08:08 +01:00
1 parent 9dd598def8
commit 43824e793b
1 file changed
+1 -6
+1 -6
View File
@@ -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 = &params->color,
.metadata = PL_HDR_METADATA_HDR10,
.scaling = PL_HDR_NITS,
.out_max = &params->color.hdr.max_luma,
));
pl_color_space_infer(&params->color);
if (!pl_color_space_is_hdr(&params->color)) {
// Some clips have leftover HDR metadata after conversion to SDR, so to