From 8edf0af514e285454a15f14561519608e6d6aad9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 9 Dec 2020 13:13:23 +0100 Subject: Bv2.1 6.2.1: Check that the sound MXF Language tag conforms to RFC 5646. --- src/sound_asset.h | 13 +++++++++++++ src/verify.cc | 11 ++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/sound_asset.h b/src/sound_asset.h index 91a213b8..d4b41a1a 100644 --- a/src/sound_asset.h +++ b/src/sound_asset.h @@ -45,6 +45,16 @@ #include "sound_frame.h" #include "sound_asset_reader.h" + +namespace dcp { + class SoundAsset; +} + +extern std::shared_ptr simple_sound ( + boost::filesystem::path path, std::string suffix, dcp::MXFMetadata mxf_meta, std::string language + ); + + namespace dcp { @@ -95,6 +105,9 @@ public: private: friend class SoundAssetWriter; + friend std::shared_ptr (::simple_sound) ( + boost::filesystem::path path, std::string suffix, dcp::MXFMetadata mxf_meta, std::string language + ); std::string pkl_type (Standard standard) const { return static_pkl_type (standard); diff --git a/src/verify.cc b/src/verify.cc index 89d84eef..eec63d51 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -532,26 +532,31 @@ verify_main_sound_asset ( list& notes ) { - stage ("Checking sound asset hash", reel->main_sound()->asset()->file()); + shared_ptr asset = reel->main_sound()->asset(); + stage ("Checking sound asset hash", asset->file()); VerifyAssetResult const r = verify_asset (dcp, reel->main_sound(), progress); switch (r) { case VERIFY_ASSET_RESULT_BAD: notes.push_back ( VerificationNote( - VerificationNote::VERIFY_ERROR, VerificationNote::SOUND_HASH_INCORRECT, *reel->main_sound()->asset()->file() + VerificationNote::VERIFY_ERROR, VerificationNote::SOUND_HASH_INCORRECT, *asset->file() ) ); break; case VERIFY_ASSET_RESULT_CPL_PKL_DIFFER: notes.push_back ( VerificationNote( - VerificationNote::VERIFY_ERROR, VerificationNote::PKL_CPL_SOUND_HASHES_DISAGREE, *reel->main_sound()->asset()->file() + VerificationNote::VERIFY_ERROR, VerificationNote::PKL_CPL_SOUND_HASHES_DISAGREE, *asset->file() ) ); break; default: break; } + + stage ("Checking sound asset metadata", asset->file()); + + verify_language_tag (asset->language(), notes); } -- cgit v1.2.3