summaryrefslogtreecommitdiff
path: root/src/lib/dcp_video.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-05-23 01:23:43 +0200
committerCarl Hetherington <cth@carlh.net>2025-05-26 21:51:18 +0200
commit1d5c211dadb9a9dc2318adce86ca9c31b367cabe (patch)
treea0804622a7ceb6d9bcdc4f39732496361c53535d /src/lib/dcp_video.cc
parentfd84c01c1c562093e99127a3a82f33d401a07655 (diff)
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.
Diffstat (limited to 'src/lib/dcp_video.cc')
-rw-r--r--src/lib/dcp_video.cc3
1 files changed, 2 insertions, 1 deletions
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<const PlayerVideo> frame)
{
shared_ptr<dcp::OpenJPEGImage> 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<const PlayerVideo> frame)
frame->colour_conversion().get()
);
} else {
+ auto image = frame->image([](AVPixelFormat) { return AV_PIX_FMT_XYZ12LE; }, VideoRange::FULL, false);
xyz = make_shared<dcp::OpenJPEGImage>(image->data()[0], image->size(), image->stride()[0]);
}