summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-10-18 17:48:13 +0200
committerCarl Hetherington <cth@carlh.net>2019-10-18 17:48:13 +0200
commit6dc179f7d08477ecc7bac1257b47dda048a1b878 (patch)
treee04a594ce45cd2388cfc9d92f4cbe792847b7a53 /src/lib
parent2c096eb293cf84044e3b2ea31ab0831921ec1848 (diff)
ISDCF name fixes with > 6 channels and HI/VI (#1633).
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/film.cc11
-rw-r--r--src/lib/util.cc20
2 files changed, 26 insertions, 5 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 93459661b..701eecc39 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -813,14 +813,21 @@ Film::isdcf_name (bool if_created_now) const
/* Count mapped audio channels */
- pair<int, int> ch = audio_channel_types (mapped_audio_channels(), audio_channels());
+ list<int> mapped = mapped_audio_channels ();
+
+ pair<int, int> ch = audio_channel_types (mapped, audio_channels());
if (!ch.first && !ch.second) {
d += "_MOS";
} else if (ch.first) {
d += String::compose("_%1%2", ch.first, ch.second);
}
- /* XXX: HI/VI */
+ if (audio_channels() > static_cast<int>(dcp::HI) && find(mapped.begin(), mapped.end(), dcp::HI) != mapped.end()) {
+ d += "-HI";
+ }
+ if (audio_channels() > static_cast<int>(dcp::VI) && find(mapped.begin(), mapped.end(), dcp::VI) != mapped.end()) {
+ d += "-VI";
+ }
d += "_" + resolution_to_string (_resolution);
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 2dedc32c1..cd2d5a368 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -779,7 +779,7 @@ careful_string_filter (string s)
/** @param mapped List of mapped audio channels from a Film.
* @param channels Total number of channels in the Film.
- * @return First: number of non-LFE channels, second: number of LFE channels.
+ * @return First: number of non-LFE soundtrack channels (L/R/C/Ls/Rs/Lc/Rc/Bsl/Bsr), second: number of LFE channels.
*/
pair<int, int>
audio_channel_types (list<int> mapped, int channels)
@@ -793,10 +793,24 @@ audio_channel_types (list<int> mapped, int channels)
continue;
}
- if (static_cast<dcp::Channel> (i) == dcp::LFE) {
+ switch (static_cast<dcp::Channel>(i)) {
+ case dcp::LFE:
++lfe;
- } else {
+ break;
+ case dcp::LEFT:
+ case dcp::RIGHT:
+ case dcp::CENTRE:
+ case dcp::LS:
+ case dcp::RS:
+ case dcp::LC:
+ case dcp::RC:
+ case dcp::BSL:
+ case dcp::BSR:
++non_lfe;
+ break;
+ case dcp::HI:
+ case dcp::VI:
+ break;
}
}