Fix ISDCF name test and add check to see if a mapped channel is included in the DCP.
[dcpomatic.git] / src / lib / film.cc
index 3aed4d9657ff088b6464ca5ede71e78abf2d2bf0..297193f83e8ecd1669abadf668a3bd25da9396a0 100644 (file)
@@ -641,6 +641,11 @@ Film::isdcf_name (bool if_created_now) const
        int non_lfe = 0;
        int lfe = 0;
        for (list<dcp::Channel>::const_iterator i = mapped.begin(); i != mapped.end(); ++i) {
+               if (static_cast<int> (*i) >= audio_channels()) {
+                       /* This channel is mapped but is not included in the DCP */
+                       continue;
+               }
+               
                if ((*i) == dcp::LFE) {
                        ++lfe;
                } else {