X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Futil.cc;h=cd2d5a3685d506d9d84a09a557f4e9e512f39499;hp=2dedc32c152efc60161722d411c7ef0511b018df;hb=6dc179f7d08477ecc7bac1257b47dda048a1b878;hpb=2c096eb293cf84044e3b2ea31ab0831921ec1848 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 audio_channel_types (list mapped, int channels) @@ -793,10 +793,24 @@ audio_channel_types (list mapped, int channels) continue; } - if (static_cast (i) == dcp::LFE) { + switch (static_cast(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; } }