From 1d5c211dadb9a9dc2318adce86ca9c31b367cabe Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 23 May 2025 01:23:43 +0200 Subject: Fix incorrect colours with "no colourspace conversion" sources that are not AV_PIX_FMT_XYZ12LE. Prepare the image for where it is going to next. I don't understand the difference in this situation between XYZ12LE and RGB48LE (it seems they are both 16-bit-per-channel) but there you go. --- src/lib/dcp_video.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib/dcp_video.cc') diff --git a/src/lib/dcp_video.cc b/src/lib/dcp_video.cc index a7a360cb3..525a755b8 100644 --- a/src/lib/dcp_video.cc +++ b/src/lib/dcp_video.cc @@ -101,8 +101,8 @@ DCPVideo::convert_to_xyz(shared_ptr frame) { shared_ptr xyz; - auto image = frame->image(bind(&PlayerVideo::keep_xyz_or_rgb, _1), VideoRange::FULL, false); if (frame->colour_conversion()) { + auto image = frame->image([](AVPixelFormat) { return AV_PIX_FMT_RGB48LE; }, VideoRange::FULL, false); xyz = dcp::rgb_to_xyz( image->data()[0], image->size(), @@ -110,6 +110,7 @@ DCPVideo::convert_to_xyz(shared_ptr frame) frame->colour_conversion().get() ); } else { + auto image = frame->image([](AVPixelFormat) { return AV_PIX_FMT_XYZ12LE; }, VideoRange::FULL, false); xyz = make_shared(image->data()[0], image->size(), image->stride()[0]); } -- cgit v1.2.3