Add xsd_path() and use it to fix access to .xsd files on Linux (#1830).
[dcpomatic.git] / src / lib / types.cc
index 9806c99712eb8d1a6c87e43cab4f39aeb530921f..df57f2d47143a470b1ed88ae11a6e0ac699abf4b 100644 (file)
 #include "types.h"
 #include "compose.hpp"
 #include "dcpomatic_assert.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
 #include <dcp/cpl.h>
 #include <dcp/dcp.h>
 #include <dcp/reel_mxf.h>
 #include <dcp/reel_asset.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <libcxml/cxml.h>
 #include <boost/foreach.hpp>
 
@@ -194,10 +197,14 @@ CPLSummary::CPLSummary (boost::filesystem::path p)
        : dcp_directory (p.leaf().string())
 {
        dcp::DCP dcp (p);
+
        list<dcp::VerificationNote> notes;
        dcp.read (&notes);
-       if (!notes.empty()) {
-               throw dcp::DCPReadError(dcp::note_to_string(notes.front()));
+       BOOST_FOREACH (dcp::VerificationNote i, notes) {
+               if (i.code() != dcp::VerificationNote::EXTERNAL_ASSET) {
+                       /* It's not just a warning about this DCP being a VF */
+                       throw dcp::ReadError(dcp::note_to_string(i));
+               }
        }
 
        cpl_id = dcp.cpls().front()->id();