Store reel lengths in DCPContent to speed up e.g. timeline with many DCPs.
[dcpomatic.git] / src / lib / dcp_examiner.cc
index 74640ff00358146b8c3dc0f8307ea35aa7d3b9e1..9969245305211b901a4ec66db317af6d53143c51 100644 (file)
@@ -163,6 +163,14 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content)
 
                        _has_subtitles = true;
                }
+
+               if (i->main_picture()) {
+                       _reel_lengths.push_back (i->main_picture()->duration());
+               } else if (i->main_sound()) {
+                       _reel_lengths.push_back (i->main_sound()->duration());
+               } else if (i->main_subtitle()) {
+                       _reel_lengths.push_back (i->main_subtitle()->duration());
+               }
        }
 
        _encrypted = cpl->encrypted ();