Make Atmos content work more like other content. Now its MXFs
[dcpomatic.git] / src / lib / dcp_content.cc
index 4280ad13aa7474b698a5255c3e2e635216d15ba2..d2c1df748ddc5d3dbf529a0f3ea4f7147f4d42a1 100644 (file)
@@ -18,6 +18,7 @@
 
 */
 
+#include "atmos_content.h"
 #include "dcp_content.h"
 #include "video_content.h"
 #include "audio_content.h"
@@ -233,6 +234,11 @@ DCPContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
                as->set_mapping (m);
        }
 
+       if (examiner->has_atmos()) {
+               boost::mutex::scoped_lock lm (_mutex);
+               atmos.reset (new AtmosContent(this));
+       }
+
        int texts = 0;
        {
                boost::mutex::scoped_lock lm (_mutex);
@@ -610,7 +616,7 @@ DCPContent::can_reference (shared_ptr<const Film> film, function<bool (shared_pt
 static
 bool check_video (shared_ptr<const Content> c)
 {
-       return static_cast<bool>(c->video);
+       return static_cast<bool>(c->video) && c->video->use();
 }
 
 bool
@@ -643,7 +649,7 @@ DCPContent::can_reference_video (shared_ptr<const Film> film, string& why_not) c
 static
 bool check_audio (shared_ptr<const Content> c)
 {
-       return static_cast<bool>(c->audio);
+       return static_cast<bool>(c->audio) && !c->audio->mapping().mapped_output_channels().empty();
 }
 
 bool