DCPExaminer must find Atmos length / edit rate.
authorCarl Hetherington <cth@carlh.net>
Fri, 19 Jun 2020 18:29:55 +0000 (20:29 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 19 Jun 2020 18:29:55 +0000 (20:29 +0200)
src/lib/dcp_examiner.cc
src/lib/dcp_examiner.h

index 133c161..b05ef59 100644 (file)
@@ -67,6 +67,7 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
        , _kdm_valid (false)
        , _three_d (false)
        , _has_atmos (false)
+       , _atmos_length (0)
 {
        shared_ptr<dcp::CPL> cpl;
 
@@ -198,6 +199,11 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
 
                if (i->atmos()) {
                        _has_atmos = true;
+                       _atmos_length += i->atmos()->actual_duration();
+                       if (_atmos_edit_rate != dcp::Fraction()) {
+                               DCPOMATIC_ASSERT (i->atmos()->edit_rate() == _atmos_edit_rate);
+                       }
+                       _atmos_edit_rate = i->atmos()->edit_rate();
                }
 
                if (i->main_picture()) {
index b4c8759..78d2bef 100644 (file)
@@ -135,6 +135,14 @@ public:
                return _has_atmos;
        }
 
+       Frame atmos_length () const {
+               return _atmos_length;
+       }
+
+       dcp::Fraction atmos_edit_rate () const {
+               return _atmos_edit_rate;
+       }
+
 private:
        boost::optional<double> _video_frame_rate;
        boost::optional<dcp::Size> _video_size;
@@ -161,4 +169,6 @@ private:
        std::vector<dcp::Rating> _ratings;
        std::string _content_version;
        bool _has_atmos;
+       Frame _atmos_length;
+       dcp::Fraction _atmos_edit_rate;
 };