summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-01-31 18:22:08 +0100
committerCarl Hetherington <cth@carlh.net>2026-01-31 18:22:08 +0100
commitd53fe6a7bb1d4934fb55b3fa9af0469a777c8091 (patch)
tree493af709732c5ee5e3202a37b5f69ecfe71ea400
parentebcc22dc9db55f762f35b9c408163df847ba804f (diff)
Fix failure to write XML for a VF DCP.
This would break e.g. the DoM editor when trying to edit VFs.
-rw-r--r--src/dcp.cc4
-rw-r--r--test/dcp_test.cc25
2 files changed, 27 insertions, 2 deletions
diff --git a/src/dcp.cc b/src/dcp.cc
index 31c3e077..40690065 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -505,7 +505,7 @@ DCP::write_xml(
/* The assets may have changed since we read the PKL, so re-add them */
pkl->clear_assets();
- for (auto asset: assets()) {
+ for (auto asset: assets(true)) {
asset->add_to_pkl(pkl, _directory);
}
@@ -527,7 +527,7 @@ DCP::write_xml(
/* The assets may have changed since we read the asset map, so re-add them */
_asset_map->clear_assets();
_asset_map->add_asset(pkl->id(), _directory / pkl_filename, true);
- for (auto asset: assets()) {
+ for (auto asset: assets(true)) {
asset->add_to_assetmap(*_asset_map, _directory);
}
diff --git a/test/dcp_test.cc b/test/dcp_test.cc
index d0185d76..e4ffab55 100644
--- a/test/dcp_test.cc
+++ b/test/dcp_test.cc
@@ -545,3 +545,28 @@ BOOST_AUTO_TEST_CASE(hashes_preserved_when_loading_corrupted_dcp)
*/
BOOST_CHECK_EQUAL(reel->main_picture()->asset_ref()->hash(), new_hash);
}
+
+
+BOOST_AUTO_TEST_CASE(can_write_vf_xml)
+{
+ auto dcp = dcp::DCP("build/test/can_write_vf_xml");
+ auto cpl = std::make_shared<dcp::CPL>("annotate", dcp::ContentKind::FEATURE, dcp::Standard::SMPTE);
+ auto picture = std::make_shared<dcp::ReelMonoPictureAsset>(
+ simple_picture("build/test/can_write_vf_xml", ""),
+ 0
+ );
+ auto sound = std::make_shared<dcp::ReelSoundAsset>(
+ dcp::make_uuid(), dcp::Fraction(24, 1), 24, 0, boost::none, boost::none
+ );
+ auto reel = std::make_shared<dcp::Reel>(
+ picture,
+ sound,
+ std::shared_ptr<dcp::ReelTextAsset>(),
+ std::shared_ptr<dcp::ReelMarkersAsset>(),
+ std::shared_ptr<dcp::ReelAtmosAsset>()
+ );
+ cpl->add(reel);
+ dcp.add(cpl);
+ dcp.write_xml();
+}
+