summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-12-08 23:31:04 +0100
committerCarl Hetherington <cth@carlh.net>2025-12-08 23:31:04 +0100
commit494406afd32db350778e7b6be2aecc7d10b15125 (patch)
treec3f634de9af5108b3fb95e41d670911d4e02d076
parentdd1f3d77c8a0171c4d947ef689b4eefed559dcbe (diff)
Extract read_assetmap().
-rw-r--r--src/dcp.cc21
-rw-r--r--src/dcp.h2
2 files changed, 16 insertions, 7 deletions
diff --git a/src/dcp.cc b/src/dcp.cc
index 5bcfca42..c01ecc96 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -136,21 +136,28 @@ DCP::operator=(DCP&& other)
}
-void
-DCP::read (vector<dcp::VerificationNote>* notes, bool ignore_incorrect_picture_mxf_type)
+AssetMap
+DCP::read_assetmap() const
{
- /* Read the ASSETMAP and PKL */
+ boost::filesystem::path path;
- boost::filesystem::path asset_map_path;
if (filesystem::exists(_directory / "ASSETMAP")) {
- asset_map_path = _directory / "ASSETMAP";
+ path = _directory / "ASSETMAP";
} else if (filesystem::exists(_directory / "ASSETMAP.xml")) {
- asset_map_path = _directory / "ASSETMAP.xml";
+ path = _directory / "ASSETMAP.xml";
} else {
boost::throw_exception(MissingAssetmapError(_directory));
}
- _asset_map = AssetMap(asset_map_path);
+ return AssetMap(path);
+}
+
+
+void
+DCP::read (vector<dcp::VerificationNote>* notes, bool ignore_incorrect_picture_mxf_type)
+{
+ /* Read the ASSETMAP and PKL */
+ _asset_map = read_assetmap();
auto const pkl_paths = _asset_map->pkl_paths();
auto const standard = _asset_map->standard();
diff --git a/src/dcp.h b/src/dcp.h
index d9a8c0c6..482f4969 100644
--- a/src/dcp.h
+++ b/src/dcp.h
@@ -202,6 +202,8 @@ public:
private:
void write_volindex (Standard standard) const;
+ /** Throws MissingAssetmapError if asset map could not be found */
+ AssetMap read_assetmap() const;
/** The directory that we are writing to */
boost::filesystem::path _directory;