projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Throw errors from CPLSummary constructor if the DCP::read reported any problems.
[dcpomatic.git]
/
src
/
lib
/
types.cc
diff --git
a/src/lib/types.cc
b/src/lib/types.cc
index ee36431cf8755d17a42ddb5d8215cd78eaf954a1..9806c99712eb8d1a6c87e43cab4f39aeb530921f 100644
(file)
--- 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::max;
using std::min;
using std::string;
+using std::list;
using boost::shared_ptr;
using dcp::raw_convert;
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_directory (p.leaf().string())
{
dcp::DCP dcp (p);
- dcp.read ();
+ list<dcp::VerificationNote> 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();
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<dcp::CPL> j, dcp.cpls()) {
encrypted = false;
BOOST_FOREACH (shared_ptr<dcp::CPL> j, dcp.cpls()) {
- BOOST_FOREACH (shared_ptr<const dcp::ReelAsset> k, j->reel_assets()) {
- shared_ptr<const dcp::ReelMXF> mxf = boost::dynamic_pointer_cast<const dcp::ReelMXF> (k);
- if (mxf && mxf->key_id()) {
+ BOOST_FOREACH (shared_ptr<const dcp::ReelMXF> k, j->reel_mxfs()) {
+ if (k->key_id()) {
encrypted = true;
}
}
}
encrypted = true;
}
}
}
+
+ last_write_time = boost::filesystem::last_write_time (p);
}
}