dcpdiff option to allow issue dates to differ.
[libdcp.git] / src / dcp.cc
index 884e3cb5944f1f63786e9cd55d68cd0ee03543a9..c0fe70f64ad4d0a99d2503c9f03d7b12a40edca2 100644 (file)
@@ -69,7 +69,6 @@ using std::vector;
 using std::cout;
 using std::make_pair;
 using std::map;
-using std::cout;
 using std::cerr;
 using std::exception;
 using boost::shared_ptr;
@@ -81,7 +80,7 @@ static string const assetmap_interop_ns = "http://www.digicine.com/PROTO-ASDCP-A
 static string const assetmap_smpte_ns   = "http://www.smpte-ra.org/schemas/429-9/2007/AM";
 static string const pkl_interop_ns      = "http://www.digicine.com/PROTO-ASDCP-PKL-20040311#";
 static string const pkl_smpte_ns        = "http://www.smpte-ra.org/schemas/429-8/2007/PKL";
-static string const volindex_interop_ns = "http://www.digicine.com/PROTO-ASDCP-AM-20040311#";
+static string const volindex_interop_ns = "http://www.digicine.com/PROTO-ASDCP-VL-20040311#";
 static string const volindex_smpte_ns   = "http://www.smpte-ra.org/schemas/429-9/2007/AM";
 
 DCP::DCP (boost::filesystem::path directory)
@@ -224,7 +223,7 @@ DCP::read (bool keep_going, ReadErrors* errors, bool ignore_incorrect_picture_mx
                                        other_assets.push_back (shared_ptr<SMPTESubtitleAsset> (new SMPTESubtitleAsset (path)));
                                        break;
                                default:
-                                       throw DCPReadError ("Unknown MXF essence type");
+                                       throw DCPReadError (String::compose ("Unknown MXF essence type %1 in %2", int(type), path.string()));
                        }
                } else if (boost::filesystem::extension (path) == ".ttf") {
                        other_assets.push_back (shared_ptr<FontAsset> (new FontAsset (i->first, path)));
@@ -481,14 +480,20 @@ DCP::cpls () const
        return _cpls;
 }
 
-/** @return All assets (including CPLs) */
+/** @param ignore_unresolved true to silently ignore unresolved assets, otherwise
+ *  an exception is thrown if they are found.
+ *  @return All assets (including CPLs).
+ */
 list<shared_ptr<Asset> >
-DCP::assets () const
+DCP::assets (bool ignore_unresolved) const
 {
        list<shared_ptr<Asset> > assets;
        BOOST_FOREACH (shared_ptr<CPL> i, cpls ()) {
                assets.push_back (i);
                BOOST_FOREACH (shared_ptr<const ReelAsset> j, i->reel_assets ()) {
+                       if (ignore_unresolved && !j->asset_ref().resolved()) {
+                               continue;
+                       }
                        shared_ptr<Asset> o = j->asset_ref().asset ();
                        assets.push_back (o);
                        /* More Interop special-casing */