Skip to content

Commit 94ca7bd

Browse files
committed
renderer: ignore input frame ICC luminance
50a7571 suppose to allow use of user provided luminance metadata, but as a side effect value of 0 caused the frame to be actually
1 parent 05269bf commit 94ca7bd

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/renderer.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3404,9 +3404,13 @@ static void icc_fallback(struct pass_state *pass, struct pl_frame *frame,
34043404

34053405
#ifdef PL_HAVE_LCMS
34063406
pl_renderer rr = pass->rr;
3407-
struct pl_icc_params *params = pl_icc_params(
3408-
.max_luma = frame->color.hdr.max_luma,
3409-
);
3407+
struct pl_icc_params *params = pl_icc_params();
3408+
// When frame max_luma is not set it, default SDR white value is forced.
3409+
// Luminance value encoded in ICC is ignored. Using ICC luminance in our case
3410+
// makes no much sense, as we want to put image at reference white anyway,
3411+
// which likely will be different from ICC luminance.
3412+
if (frame->color.hdr.max_luma > 0.0f)
3413+
params->max_luma = frame->color.hdr.max_luma;
34103414
if (pl_icc_update(rr->log, &fallback->icc, &frame->profile, params)) {
34113415
frame->icc = fallback->icc;
34123416
} else {

0 commit comments

Comments
 (0)