diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-05-23 14:38:50 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-05-23 14:38:50 +0100 |
| commit | a545db4651e56eff854e2ed797f849b17bf108c9 (patch) | |
| tree | aa754ca673c24bfbd9eb36c5b1092916f38437a9 /src | |
| parent | 29b1e040e64b8ffc69fe9a9a126d8c318a71cfae (diff) | |
| parent | 92bec5911dc89d08f2a04fbdcfc32a8f274a5065 (diff) | |
Merge branch '1.0' of git.carlh.net:git/libdcp into 1.0
Diffstat (limited to 'src')
| -rw-r--r-- | src/decrypted_kdm.cc | 1 | ||||
| -rw-r--r-- | src/encrypted_kdm.cc | 2 | ||||
| -rw-r--r-- | src/encrypted_kdm.h | 1 | ||||
| -rw-r--r-- | src/sound_asset.cc | 20 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/decrypted_kdm.cc b/src/decrypted_kdm.cc index 6aba26de..b18d9a90 100644 --- a/src/decrypted_kdm.cc +++ b/src/decrypted_kdm.cc @@ -310,6 +310,7 @@ DecryptedKDM::encrypt (shared_ptr<const CertificateChain> signer, Certificate re device_list_description, _keys.front().cpl_id (), _content_title_text, + _annotation_text, _not_valid_before, _not_valid_after, formulation, diff --git a/src/encrypted_kdm.cc b/src/encrypted_kdm.cc index 8ed0c315..0e10a528 100644 --- a/src/encrypted_kdm.cc +++ b/src/encrypted_kdm.cc @@ -519,6 +519,7 @@ EncryptedKDM::EncryptedKDM ( string device_list_description, string cpl_id, string content_title_text, + optional<string> annotation_text, LocalTime not_valid_before, LocalTime not_valid_after, Formulation formulation, @@ -532,6 +533,7 @@ EncryptedKDM::EncryptedKDM ( data::AuthenticatedPublic& aup = _data->authenticated_public; aup.signer.x509_issuer_name = signer->leaf().issuer (); aup.signer.x509_serial_number = signer->leaf().serial (); + aup.annotation_text = annotation_text; data::KDMRequiredExtensions& kre = _data->authenticated_public.required_extensions.kdm_required_extensions; kre.recipient.x509_issuer_serial.x509_issuer_name = recipient.issuer (); diff --git a/src/encrypted_kdm.h b/src/encrypted_kdm.h index a36e7aaf..13cb1a00 100644 --- a/src/encrypted_kdm.h +++ b/src/encrypted_kdm.h @@ -89,6 +89,7 @@ private: std::string device_list_description, std::string cpl_id, std::string cpl_content_title_text, + boost::optional<std::string> annotation_text, LocalTime not_valid_before, LocalTime not_valid_after, Formulation formulation, diff --git a/src/sound_asset.cc b/src/sound_asset.cc index b9be77c8..1ccd9a48 100644 --- a/src/sound_asset.cc +++ b/src/sound_asset.cc @@ -41,6 +41,7 @@ using std::ostream; using std::vector; using std::list; using boost::shared_ptr; +using boost::dynamic_pointer_cast; using namespace dcp; SoundAsset::SoundAsset (boost::filesystem::path file) @@ -121,26 +122,21 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHand return false; } - ASDCP::PCM::FrameBuffer buffer_A (1 * Kumu::Megabyte); - ASDCP::PCM::FrameBuffer buffer_B (1 * Kumu::Megabyte); + shared_ptr<const SoundAsset> other_sound = dynamic_pointer_cast<const SoundAsset> (other); for (int i = 0; i < _intrinsic_duration; ++i) { - if (ASDCP_FAILURE (reader_A.ReadFrame (i, buffer_A))) { - boost::throw_exception (DCPReadError ("could not read audio frame")); - } - if (ASDCP_FAILURE (reader_B.ReadFrame (i, buffer_B))) { - boost::throw_exception (DCPReadError ("could not read audio frame")); - } + shared_ptr<const SoundFrame> frame_A = get_frame (i); + shared_ptr<const SoundFrame> frame_B = other_sound->get_frame (i); - if (buffer_A.Size() != buffer_B.Size()) { + if (frame_A->size() != frame_B->size()) { note (DCP_ERROR, String::compose ("sizes of audio data for frame %1 differ", i)); return false; } - if (memcmp (buffer_A.RoData(), buffer_B.RoData(), buffer_A.Size()) != 0) { - for (uint32_t i = 0; i < buffer_A.Size(); ++i) { - int const d = abs (buffer_A.RoData()[i] - buffer_B.RoData()[i]); + if (memcmp (frame_A->data(), frame_B->data(), frame_A->size()) != 0) { + for (int i = 0; i < frame_A->size(); ++i) { + int const d = abs (frame_A->data()[i] - frame_B->data()[i]); if (d > opt.max_audio_sample_error) { note (DCP_ERROR, String::compose ("PCM data difference of %1", d)); return false; |
