From f657337815c5f21e2edd99fdaa501f0ff8acc6b1 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 21 Dec 2022 00:12:41 +0100 Subject: Set plaintext offset to 0 when writing J2K frames (DoM #2391) Without this the EasyDCP verifier gives errors like "sum of individual components is larger than the file size" This change results in there being no plaintext metadata in each encoded frame. It looks like the DCP-2000 was fixed in around 2010 to not crash with plaintext metadata, and the asdcplib tools at some point started defaulting to this behaviour also. --- src/mono_picture_asset_writer.cc | 2 ++ src/stereo_picture_asset_writer.cc | 2 ++ 2 files changed, 4 insertions(+) (limited to 'src') diff --git a/src/mono_picture_asset_writer.cc b/src/mono_picture_asset_writer.cc index dd29c19a..7fd58114 100644 --- a/src/mono_picture_asset_writer.cc +++ b/src/mono_picture_asset_writer.cc @@ -106,6 +106,8 @@ MonoPictureAssetWriter::write (uint8_t const * data, int size) boost::throw_exception (MiscError ("could not parse J2K frame")); } + _state->frame_buffer.PlaintextOffset(0); + uint64_t const before_offset = _state->mxf_writer.Tell (); string hash; diff --git a/src/stereo_picture_asset_writer.cc b/src/stereo_picture_asset_writer.cc index b9120cd9..6ee271bc 100644 --- a/src/stereo_picture_asset_writer.cc +++ b/src/stereo_picture_asset_writer.cc @@ -100,6 +100,8 @@ StereoPictureAssetWriter::write (uint8_t const * data, int size) boost::throw_exception (MiscError ("could not parse J2K frame")); } + _state->frame_buffer.PlaintextOffset(0); + uint64_t const before_offset = _state->mxf_writer.Tell (); string hash; -- cgit v1.2.3