diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-09 11:13:02 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-09 11:13:02 +0100 |
| commit | 5c1b079a28941781c9cfa46d57e0c20b55681b32 (patch) | |
| tree | 35c0d2aac409ca1b52699e974f299a64aa5ffc1f /src/asset.cc | |
| parent | 6425742f95a4c2e539061b29016a4a5bd10ac9ae (diff) | |
Basically-working interop subtitle font handling.
Diffstat (limited to 'src/asset.cc')
| -rw-r--r-- | src/asset.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/asset.cc b/src/asset.cc index 24fc5919..5760c905 100644 --- a/src/asset.cc +++ b/src/asset.cc @@ -71,10 +71,16 @@ Asset::write_to_assetmap (xmlpp::Node* node, boost::filesystem::path root) const 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 (root, _file); + + 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)); } + chunk->add_child("Path")->add_child_text (path.get().string ()); chunk->add_child("VolumeIndex")->add_child_text ("1"); chunk->add_child("Offset")->add_child_text ("0"); |
