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 133c1614e922b5b5f8b6efbcb8a88d7321c2d785..b05ef593b7e538735f1067119db13ff23b26ed14 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 b4c87596c70e354079937132d289a06ed2ba8a42..78d2befd3b3115631d81290f714ed858c6a64809 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;
 };