#include "exceptions.h"
#include "compose.hpp"
#include "raw_convert.h"
+#include "smpte_subtitle_asset.h"
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/parsers/AbstractDOMParser.hpp>
list<VerificationNote>& notes
)
{
- stage ("Checking sound asset hash", reel->main_sound()->asset()->file());
+ shared_ptr<dcp::SoundAsset> 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);
}
list<VerificationNote>& notes
)
{
- shared_ptr<ReelSubtitleAsset> reel_asset = reel->main_subtitle ();
- stage ("Checking subtitle XML", reel->main_subtitle()->asset()->file());
+ shared_ptr<SubtitleAsset> asset = reel->main_subtitle()->asset();
+ stage ("Checking subtitle XML", asset->file());
/* Note: we must not use SubtitleAsset::xml_as_string() here as that will mean the data on disk
* gets passed through libdcp which may clean up and therefore hide errors.
*/
- validate_xml (reel->main_subtitle()->asset()->raw_xml(), xsd_dtd_directory, notes);
+ validate_xml (asset->raw_xml(), xsd_dtd_directory, notes);
+
+ shared_ptr<SMPTESubtitleAsset> smpte = dynamic_pointer_cast<SMPTESubtitleAsset>(asset);
+ if (smpte) {
+ if (smpte->language()) {
+ verify_language_tag (*smpte->language(), notes);
+ }
+ }
}