From deb3fc481502a885f26b331c2118a082bdcd4467 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 15 Nov 2018 11:43:18 +0000 Subject: Better error message when loading a DCP with no ASSETMAP{,.xml} --- src/lib/dcp_content.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/lib') diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index c73d0df86..cc636b0bf 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -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 -- cgit v1.2.3