Merge branch 'main' into v2.17.x
[dcpomatic.git] / src / lib / dcp_content.cc
index 378ba18827e7ccd32b8bfe1946cfd8e8b77f2a26..c459a9ece6e099aa82d9a09ac50cfbef72f6d3a8 100644 (file)
@@ -723,6 +723,14 @@ DCPContent::can_reference_audio (shared_ptr<const Film> film, string& why_not) c
                return false;
        }
 
+       if (audio && audio->stream()) {
+               auto const channels = audio->stream()->channels();
+               if (channels != film->audio_channels()) {
+                       why_not = String::compose(_("it has a different number of audio channels than the project; set the project to have %1 channels."), channels);
+                       return false;
+               }
+       }
+
        auto part = [](shared_ptr<const Content> c) {
                return static_cast<bool>(c->audio) && !c->audio->mapping().mapped_output_channels().empty();
        };