Merge branch 'master' of ssh://git.carlh.net/home/carl/git/dcpomatic
[dcpomatic.git] / src / lib / dcp_examiner.cc
index e25583cb69064b9ac3dd2fdb7352ab17c13efece..80887a609eb01f9c593e5e1bfb4f4c7841a3cfe6 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 ();
@@ -192,10 +200,8 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content)
                }
        } catch (dcp::DCPReadError& e) {
                _kdm_valid = false;
-               if (_encrypted && content->kdm ()) {
-                       /* XXX: maybe don't use an exception for this */
-                       throw runtime_error (_("The KDM does not decrypt the DCP.  Perhaps it is targeted at the wrong CPL."));
-               }
+       } catch (dcp::MiscError& e) {
+               _kdm_valid = false;
        }
 
        DCPOMATIC_ASSERT (cpl->standard ());