X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fmxf.cc;h=1c493901e72c47102799c059a17a55dda38f047e;hb=689d56339857b0a82156641f28392b8d2f11beea;hp=0cde395c1ca92752ff0505a85b0ec0e5ed5f72b4;hpb=42a65cba0d8da23c12af52015e66cd9dc0b5a5fa;p=libdcp.git diff --git a/src/mxf.cc b/src/mxf.cc index 0cde395c..1c493901 100644 --- a/src/mxf.cc +++ b/src/mxf.cc @@ -36,6 +36,7 @@ #include using std::string; +using std::cout; using std::list; using std::pair; using boost::shared_ptr; @@ -93,7 +94,7 @@ MXF::set_key (Key key) /* No key ID so far; we now need one */ _key_id = make_uuid (); } - + _decryption_context = new ASDCP::AESDecContext; if (ASDCP_FAILURE (_decryption_context->InitKey (_key->value ()))) { throw MiscError ("could not set up decryption context"); @@ -105,11 +106,13 @@ MXF::read_writer_info (ASDCP::WriterInfo const & info) { char buffer[64]; - Kumu::bin2UUIDhex (info.CryptographicKeyID, ASDCP::UUIDlen, buffer, sizeof (buffer)); - _key_id = buffer; + if (info.EncryptedEssence) { + Kumu::bin2UUIDhex (info.CryptographicKeyID, ASDCP::UUIDlen, buffer, sizeof (buffer)); + _key_id = buffer; + } _metadata.read (info); - + Kumu::bin2UUIDhex (info.AssetUUID, ASDCP::UUIDlen, buffer, sizeof (buffer)); return buffer; }