X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ftypes.cc;h=9806c99712eb8d1a6c87e43cab4f39aeb530921f;hb=cc8ea498a3ff9421765a99c347e03533cb0595d4;hp=ee36431cf8755d17a42ddb5d8215cd78eaf954a1;hpb=835fd0fd7ee052edc001ac8fe3c928d1de7367e8;p=dcpomatic.git diff --git a/src/lib/types.cc b/src/lib/types.cc index ee36431cf..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,11 +206,12 @@ 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; } } } + + last_write_time = boost::filesystem::last_write_time (p); }