diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-08-25 11:47:26 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-08-25 11:55:16 +0200 |
| commit | 97570ebdf7c0dc12a8218a143e2803ec7a792526 (patch) | |
| tree | 6c0a94e3019f09da352228cac3f49295a5a0558c | |
| parent | b583ec397c812ba11280163d7c480a2e0d6bb3e6 (diff) | |
Write subtitles and fonts to subdirectories when combining Interop (#3079).v1.10.25
| -rw-r--r-- | src/combine.cc | 5 | ||||
| -rw-r--r-- | test/combine_test.cc | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/combine.cc b/src/combine.cc index fa90ee84..5930ff19 100644 --- a/src/combine.cc +++ b/src/combine.cc @@ -147,13 +147,14 @@ dcp::combine( * re-write the subtitle XML file since the font URI might have changed * if it's a duplicate with another DCP. */ + boost::filesystem::create_directories(output / sub->id()); auto fonts = sub->font_filenames(); for (auto const& k: fonts) { - sub->set_font_file(k.first, make_unique(output / k.second.filename())); + sub->set_font_file(k.first, make_unique(output / sub->id() / k.second.filename())); } auto const file = sub->file(); DCP_ASSERT(file); - auto const new_path = make_unique(output / file->filename()); + auto const new_path = make_unique(output / sub->id() / file->filename()); sub->write(new_path); already_written.insert(sub->id()); add_to_container(assets, sub->font_assets()); diff --git a/test/combine_test.cc b/test/combine_test.cc index a6df6f06..402a8c72 100644 --- a/test/combine_test.cc +++ b/test/combine_test.cc @@ -532,6 +532,11 @@ BOOST_AUTO_TEST_CASE(combine_ov_with_vf) for (auto i: boost::filesystem::recursive_directory_iterator(out_path)) { if (boost::filesystem::extension(i.path()) == ".xml" && i.path().filename().string().substr(0, 3) == "sub") { ++sub_files; + std::vector<boost::filesystem::path> parts; + for (auto j: i.path().lexically_relative(out_path)) { + parts.push_back(j); + } + BOOST_CHECK_EQUAL(parts.size(), 2U); } } |
