diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-06-06 19:36:24 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-06-06 19:36:26 +0200 |
| commit | d860d9de91607aad3561e087fe83c2290ec5d42c (patch) | |
| tree | 56311538b8082903ff25e880377f9caebd2645ba /src/lib/dcp_content.cc | |
| parent | 606b342315995f8e5cc28f6ea13bef9858038d5f (diff) | |
Fix player audio, almost totally broken by a stupid mistakev2.16.59
in 78b2c650a9249cb7165d269b4378391d31e68e8b
Following that commit 16 channel audio streams were being read
as 6-channel, with unsurprising consequences.
Diffstat (limited to 'src/lib/dcp_content.cc')
| -rw-r--r-- | src/lib/dcp_content.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index 87e59de50..e2b19fb8e 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -160,6 +160,8 @@ DCPContent::DCPContent (cxml::ConstNodePtr node, int version) for (auto i: node->node_children("ContentVersion")) { _content_versions.push_back (i->content()); } + + _active_audio_channels = node->optional_number_child<int>("ActiveAudioChannels"); } void @@ -252,6 +254,8 @@ DCPContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job) 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()) { @@ -413,6 +417,10 @@ DCPContent::as_xml (xmlpp::Node* node, bool with_paths) const 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 @@ -862,3 +870,12 @@ DCPContent::check_font_ids() 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 + ); +} + |
