Trying to create export audio encoders with between 9 and 15 channels
[dcpomatic.git] / src / lib / dcp_content.cc
index 0ce4945411c3a5e5d0128df437d2dea86d8f2278..ec6894428f96438d9cc76d60506a38c64540b3b0 100644 (file)
@@ -236,8 +236,15 @@ DCPContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
        }
 
        if (examiner->has_atmos()) {
-               boost::mutex::scoped_lock lm (_mutex);
-               atmos.reset (new AtmosContent(this));
+               {
+                       boost::mutex::scoped_lock lm (_mutex);
+                       atmos.reset (new AtmosContent(this));
+               }
+               /* Setting length will cause calculations to be made based on edit rate, so that must
+                * be set up first otherwise hard-to-spot exceptions will be thrown.
+                */
+               atmos->set_edit_rate (examiner->atmos_edit_rate());
+               atmos->set_length (examiner->atmos_length());
        }
 
        int texts = 0;