X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ftypes.cc;h=9806c99712eb8d1a6c87e43cab4f39aeb530921f;hb=bcc4e2f7dc4cd5658e199ddacb7202b00ec72cf1;hp=a0095cedfdf1e96bdba7f22fd4e86a0b36943ca2;hpb=74873babf8ed3ffb3dd79858328d5b3f142479a3;p=dcpomatic.git diff --git a/src/lib/types.cc b/src/lib/types.cc index a0095cedf..9806c9971 100644 --- a/src/lib/types.cc +++ b/src/lib/types.cc @@ -35,6 +35,7 @@ using std::max; using std::min; using std::string; +using std::list; using boost::shared_ptr; using dcp::raw_convert; @@ -193,7 +194,11 @@ CPLSummary::CPLSummary (boost::filesystem::path p) : dcp_directory (p.leaf().string()) { dcp::DCP dcp (p); - dcp.read (); + list notes; + dcp.read (¬es); + if (!notes.empty()) { + throw dcp::DCPReadError(dcp::note_to_string(notes.front())); + } cpl_id = dcp.cpls().front()->id(); cpl_annotation_text = dcp.cpls().front()->annotation_text(); @@ -201,9 +206,8 @@ CPLSummary::CPLSummary (boost::filesystem::path p) encrypted = false; BOOST_FOREACH (shared_ptr j, dcp.cpls()) { - BOOST_FOREACH (shared_ptr k, j->reel_assets()) { - shared_ptr mxf = boost::dynamic_pointer_cast (k); - if (mxf && mxf->key_id()) { + BOOST_FOREACH (shared_ptr k, j->reel_mxfs()) { + if (k->key_id()) { encrypted = true; } }