diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-08-30 22:28:06 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-08-30 22:28:06 +0100 |
| commit | e4e038154f0bad3b91a57130c7a88d9fba6a488c (patch) | |
| tree | 52c0972e5de8f7e33162c8985237331807d14db6 /src/dcp.cc | |
| parent | f7180df03b0e11a697e31eeced2f1817cad14680 (diff) | |
Allow DCP reading to continue even with empty <Path> nodes in ASSETMAP.
Diffstat (limited to 'src/dcp.cc')
| -rw-r--r-- | src/dcp.cc | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -173,7 +173,12 @@ DCP::read (bool keep_going, ReadErrors* errors, bool ignore_incorrect_picture_mx _pkls.push_back (shared_ptr<PKL>(new PKL(_directory / i))); } - /* Read all the assets from the asset map */ + /* Now we have: + paths - files in the DCP that are not PKLs. + _pkls - PKL objects for each PKL. + + Read all the assets from the asset map. + */ /* Make a list of non-CPL/PKL assets so that we can resolve the references from the CPLs. @@ -183,11 +188,20 @@ DCP::read (bool keep_going, ReadErrors* errors, bool ignore_incorrect_picture_mx for (map<string, boost::filesystem::path>::const_iterator i = paths.begin(); i != paths.end(); ++i) { boost::filesystem::path path = _directory / i->second; - if (!boost::filesystem::exists (path)) { + if (i->second.empty()) { + /* I can't see how this is valid, but it's + been seen in the wild with a DCP that + claims to come from ClipsterDCI 5.10.0.5. + */ + survivable_error (keep_going, errors, EmptyAssetPathError(i->first)); + } + + if (i->second.empty() || !boost::filesystem::exists(path)) { survivable_error (keep_going, errors, MissingAssetError (path)); continue; } + /* Find the <Type> for this asset from the PKL that contains the asset */ optional<string> pkl_type; BOOST_FOREACH (shared_ptr<PKL> j, _pkls) { pkl_type = j->type(i->first); |
