Better error message when loading a DCP with no ASSETMAP{,.xml}
authorCarl Hetherington <cth@carlh.net>
Thu, 15 Nov 2018 11:43:18 +0000 (11:43 +0000)
committerCarl Hetherington <cth@carlh.net>
Thu, 15 Nov 2018 11:43:18 +0000 (11:43 +0000)
src/lib/dcp_content.cc

index c73d0df..cc636b0 100644 (file)
@@ -162,6 +162,17 @@ DCPContent::read_directory (boost::filesystem::path p)
                        read_directory (i->path());
                }
        }
+
+       bool have_assetmap = false;
+       BOOST_FOREACH (boost::filesystem::path i, paths()) {
+               if (i.filename() == "ASSETMAP" || i.filename() == "ASSETMAP.xml") {
+                       have_assetmap = true;
+               }
+       }
+
+       if (!have_assetmap) {
+               throw DCPError ("No ASSETMAP or ASSETMAP.xml file found: is this a DCP?");
+       }
 }
 
 void