for (auto i: node->node_children("ContentVersion")) {
_content_versions.push_back (i->content());
}
+
+ _active_audio_channels = node->optional_number_child<int>("ActiveAudioChannels");
}
void
auto m = as->mapping ();
m.make_default (film ? film->audio_processor() : 0);
as->set_mapping (m);
+
+ _active_audio_channels = examiner->active_audio_channels();
}
if (examiner->has_atmos()) {
for (auto i: _content_versions) {
node->add_child("ContentVersion")->add_child_text(i);
}
+
+ if (_active_audio_channels) {
+ node->add_child("ActiveAudioChannels")->add_child_text(raw_convert<string>(*_active_audio_channels));
+ }
}
DCPTime
add_fonts_from_examiner(text.front(), examiner.fonts());
}
+
+int
+DCPContent::active_audio_channels() const
+{
+ return _active_audio_channels.get_value_or(
+ (audio && audio->stream()) ? audio->stream()->channels() : 0
+ );
+}
+
return _content_versions;
}
+ int active_audio_channels() const;
+
void check_font_ids();
private:
std::map<dcp::Marker, dcpomatic::ContentTime> _markers;
std::vector<dcp::Rating> _ratings;
std::vector<std::string> _content_versions;
+
+ boost::optional<int> _active_audio_channels;
};
auto asset = reel->main_sound()->asset();
if (!_audio_channels) {
- _audio_channels = asset->active_channels();
- } else if (_audio_channels.get() != asset->active_channels()) {
+ _audio_channels = asset->channels();
+ } else if (_audio_channels.get() != asset->channels()) {
throw DCPError (_("Mismatched audio channel counts in DCP"));
}
+ if (!_active_audio_channels) {
+ _active_audio_channels = asset->active_channels();
+ } else if (_active_audio_channels.get() != asset->active_channels()) {
+ throw DCPError(_("Mismatched active audio channel counts in DCP"));
+ }
+
if (!_audio_frame_rate) {
_audio_frame_rate = asset->sampling_rate ();
} else if (_audio_frame_rate.get() != asset->sampling_rate ()) {
return _audio_channels.get_value_or (0);
}
+ int active_audio_channels() const {
+ return _active_audio_channels.get_value_or(0);
+ }
+
Frame audio_length () const override {
return _audio_length;
}
boost::optional<dcp::Size> _video_size;
Frame _video_length = 0;
boost::optional<int> _audio_channels;
+ boost::optional<int> _active_audio_channels;
boost::optional<int> _audio_frame_rate;
Frame _audio_length = 0;
std::string _name;
checked_set (_dcp[r++], wxString::Format(_("Frame rate: %d"), (int) lrint(*dcp->video_frame_rate())));
}
if (dcp->audio && !dcp->audio->streams().empty()) {
- checked_set (_dcp[r++], wxString::Format(_("Audio channels: %d"), dcp->audio->streams().front()->channels()));
+ checked_set(_dcp[r++], wxString::Format(_("Audio channels: %d"), dcp->active_audio_channels()));
}
if (!dcp->text.empty()) {
checked_set (_dcp[r++], _("Subtitles: yes"));