diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-12-08 23:31:04 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-12-08 23:31:04 +0100 |
| commit | 494406afd32db350778e7b6be2aecc7d10b15125 (patch) | |
| tree | c3f634de9af5108b3fb95e41d670911d4e02d076 | |
| parent | dd1f3d77c8a0171c4d947ef689b4eefed559dcbe (diff) | |
Extract read_assetmap().
| -rw-r--r-- | src/dcp.cc | 21 | ||||
| -rw-r--r-- | src/dcp.h | 2 |
2 files changed, 16 insertions, 7 deletions
@@ -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(); @@ -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; |
