From ef41b0c235eaa9f02203fd8438873e951bf3de07 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 4 Apr 2023 23:09:29 +0200 Subject: Add check for mismatch between sound asset and MainSoundConfiguration. --- src/verify.cc | 12 ++++++++++++ src/verify.h | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/verify.cc b/src/verify.cc index 1cab0423..8b2b11d3 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -1571,6 +1571,16 @@ verify_cpl( verify_text_details(cpl->reels(), notes); if (dcp->standard() == Standard::SMPTE) { + if (auto msc = cpl->main_sound_configuration()) { + if (state.audio_channels && msc->channels() != *state.audio_channels) { + notes.push_back({ + VerificationNote::Type::ERROR, + VerificationNote::Code::INVALID_MAIN_SOUND_CONFIGURATION, + String::compose("MainSoundConfiguration has %1 channels but sound assets have %2", msc->channels(), *state.audio_channels), + cpl->file().get() + }); + } + } if (have_main_subtitle && have_no_main_subtitle) { notes.push_back({VerificationNote::Type::BV21_ERROR, VerificationNote::Code::MISSING_MAIN_SUBTITLE_FROM_SOME_REELS}); @@ -1996,6 +2006,8 @@ dcp::note_to_string (VerificationNote note) return String::compose(" has an invalid value: %1", note.note().get()); case VerificationNote::Code::MISMATCHED_SOUND_CHANNEL_COUNTS: return String::compose("The sound assets do not all have the same channel count; the first to differ is %1", note.file()->filename()); + case VerificationNote::Code::INVALID_MAIN_SOUND_CONFIGURATION: + return String::compose(" has an invalid value: %1", note.note().get()); } return ""; diff --git a/src/verify.h b/src/verify.h index d05c92eb..7696ea85 100644 --- a/src/verify.h +++ b/src/verify.h @@ -425,7 +425,13 @@ public: /** The sound assets in the CPL do not have the same audio channel count. * file contains the filename of the first asset to differ */ - MISMATCHED_SOUND_CHANNEL_COUNTS + MISMATCHED_SOUND_CHANNEL_COUNTS, + /** The CPL contains a MainSoundConfiguration tag which does not describe the number of + * channels in the audio assets. + * note contains details of what is wrong + * file contains the CPL filename + */ + INVALID_MAIN_SOUND_CONFIGURATION, }; VerificationNote (Type type, Code code) -- cgit v1.2.3