summaryrefslogtreecommitdiff
path: root/src/asset.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/asset.cc')
-rw-r--r--src/asset.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/asset.cc b/src/asset.cc
index 3ee95227..a800e8ee 100644
--- a/src/asset.cc
+++ b/src/asset.cc
@@ -75,20 +75,23 @@ Asset::write_to_assetmap (xmlpp::Node* node, boost::filesystem::path root) const
{
DCP_ASSERT (!_file.empty ());
- xmlpp::Node* asset = node->add_child ("Asset");
- asset->add_child("Id")->add_child_text ("urn:uuid:" + _id);
- xmlpp::Node* chunk_list = asset->add_child ("ChunkList");
- xmlpp::Node* chunk = chunk_list->add_child ("Chunk");
-
optional<boost::filesystem::path> path = relative_to_root (
boost::filesystem::canonical (root),
boost::filesystem::canonical (_file)
);
if (!path) {
- throw MiscError (String::compose ("Asset %1 is not within the directory %2", _file, root));
+ /* The path of this asset is not within our DCP, so we assume it's an external
+ (referenced) one.
+ */
+ return;
}
+ xmlpp::Node* asset = node->add_child ("Asset");
+ asset->add_child("Id")->add_child_text ("urn:uuid:" + _id);
+ xmlpp::Node* chunk_list = asset->add_child ("ChunkList");
+ xmlpp::Node* chunk = chunk_list->add_child ("Chunk");
+
/* On Windows path.string() will contain back-slashes; replace these with
forward-slashes. XXX: perhaps there is a nicer way to do this with boost.
*/