diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-05-23 01:23:43 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-05-26 21:51:18 +0200 |
| commit | 1d5c211dadb9a9dc2318adce86ca9c31b367cabe (patch) | |
| tree | a0804622a7ceb6d9bcdc4f39732496361c53535d /src/lib/dcp_video.cc | |
| parent | fd84c01c1c562093e99127a3a82f33d401a07655 (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.cc | 3 |
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]); } |
