diff options
Diffstat (limited to 'src/verify.cc')
| -rw-r--r-- | src/verify.cc | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/verify.cc b/src/verify.cc index 7cc6d357..1cab0423 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -572,6 +572,13 @@ verify_main_picture_asset ( } +struct State +{ + boost::optional<string> subtitle_language; + boost::optional<int> audio_channels; +}; + + static void verify_main_sound_asset ( shared_ptr<const DCP> dcp, @@ -579,7 +586,8 @@ verify_main_sound_asset ( function<void (string, optional<boost::filesystem::path>)> stage, function<void (float)> progress, VerificationOptions options, - vector<VerificationNote>& notes + vector<VerificationNote>& notes, + State& state ) { auto asset = reel_asset->asset(); @@ -600,6 +608,12 @@ verify_main_sound_asset ( } } + if (!state.audio_channels) { + state.audio_channels = asset->channels(); + } else if (*state.audio_channels != asset->channels()) { + notes.push_back({ VerificationNote::Type::ERROR, VerificationNote::Code::MISMATCHED_SOUND_CHANNEL_COUNTS, file }); + } + stage ("Checking sound asset metadata", file); if (auto lang = asset->language()) { @@ -643,12 +657,6 @@ verify_closed_caption_reel (shared_ptr<const ReelClosedCaptionAsset> reel_asset, } -struct State -{ - boost::optional<string> subtitle_language; -}; - - /** Verify stuff that is common to both subtitles and closed captions */ void verify_smpte_timed_text_asset ( @@ -1385,7 +1393,7 @@ verify_reel( } if (reel->main_sound() && reel->main_sound()->asset_ref().resolved()) { - verify_main_sound_asset(dcp, reel->main_sound(), stage, progress, options, notes); + verify_main_sound_asset(dcp, reel->main_sound(), stage, progress, options, notes, state); } if (reel->main_subtitle()) { @@ -1986,6 +1994,8 @@ dcp::note_to_string (VerificationNote note) return String::compose("The subtitle asset %1 has no subtitles", note.note().get()); case VerificationNote::Code::INVALID_SUBTITLE_ISSUE_DATE: return String::compose("<IssueDate> 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()); } return ""; |
