summaryrefslogtreecommitdiff
path: root/src/asset.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-09-02 23:39:01 +0100
committerCarl Hetherington <cth@carlh.net>2018-09-02 23:39:01 +0100
commit8259e2771f85c33c531a83fe1a78668f158208da (patch)
tree5f1f83a1a269c7ef5a889ae5c2727d2360315896 /src/asset.cc
parentf2f2a2afc393dcaee747b97173d71a622d05d910 (diff)
Hopefully-correct PKL and AssetMap when using Interop PNG subtitles.
Diffstat (limited to 'src/asset.cc')
-rw-r--r--src/asset.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/asset.cc b/src/asset.cc
index 24fdfe6c..5b64b6cc 100644
--- a/src/asset.cc
+++ b/src/asset.cc
@@ -101,10 +101,15 @@ void
Asset::write_to_assetmap (xmlpp::Node* node, boost::filesystem::path root) const
{
DCP_ASSERT (_file);
+ write_file_to_assetmap (node, root, _file.get(), _id);
+}
+void
+Asset::write_file_to_assetmap (xmlpp::Node* node, boost::filesystem::path root, boost::filesystem::path file, string id)
+{
optional<boost::filesystem::path> path = relative_to_root (
boost::filesystem::canonical (root),
- boost::filesystem::canonical (_file.get())
+ boost::filesystem::canonical (file)
);
if (!path) {
@@ -115,14 +120,14 @@ Asset::write_to_assetmap (xmlpp::Node* node, boost::filesystem::path root) const
}
xmlpp::Node* asset = node->add_child ("Asset");
- asset->add_child("Id")->add_child_text ("urn:uuid:" + _id);
+ 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");
chunk->add_child("Path")->add_child_text (path.get().generic_string());
chunk->add_child("VolumeIndex")->add_child_text ("1");
chunk->add_child("Offset")->add_child_text ("0");
- chunk->add_child("Length")->add_child_text (raw_convert<string> (boost::filesystem::file_size (_file.get())));
+ chunk->add_child("Length")->add_child_text (raw_convert<string> (boost::filesystem::file_size (file)));
}
string