summaryrefslogtreecommitdiff
path: root/src/stereo_picture_frame.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-06-04 14:37:43 +0200
committerCarl Hetherington <cth@carlh.net>2021-06-04 14:37:43 +0200
commita5bd2e9eeecccb1a64aa7f3ae936698fce78bea5 (patch)
tree34136bd6b8dc487d578ded06da9d223424da910a /src/stereo_picture_frame.cc
parente8c71ec28755e77bd6851b9ffd698794d214208a (diff)
Add option to ignore mismatched HMACs when reading MXFs.
Diffstat (limited to 'src/stereo_picture_frame.cc')
-rw-r--r--src/stereo_picture_frame.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/stereo_picture_frame.cc b/src/stereo_picture_frame.cc
index 4cb9f2a1..8d3a2757 100644
--- a/src/stereo_picture_frame.cc
+++ b/src/stereo_picture_frame.cc
@@ -94,13 +94,14 @@ StereoPictureFrame::Part::size () const
/** Make a picture frame from a 3D (stereoscopic) asset.
* @param reader Reader for the MXF file.
* @param n Frame within the asset, not taking EntryPoint into account.
+ * @param check_hmac true to check the HMAC and give an error if it is not as expected.
*/
-StereoPictureFrame::StereoPictureFrame (ASDCP::JP2K::MXFSReader* reader, int n, shared_ptr<DecryptionContext> c)
+StereoPictureFrame::StereoPictureFrame (ASDCP::JP2K::MXFSReader* reader, int n, shared_ptr<DecryptionContext> c, bool check_hmac)
{
/* XXX: unfortunate guesswork on this buffer size */
_buffer = make_shared<ASDCP::JP2K::SFrameBuffer>(4 * Kumu::Megabyte);
- if (ASDCP_FAILURE (reader->ReadFrame (n, *_buffer, c->context(), c->hmac()))) {
+ if (ASDCP_FAILURE (reader->ReadFrame (n, *_buffer, c->context(), check_hmac ? c->hmac() : nullptr))) {
boost::throw_exception (ReadError (String::compose ("could not read video frame %1 of %2", n)));
}
}