summaryrefslogtreecommitdiff
path: root/src/verify_internal.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-05-08 22:24:14 +0200
committerCarl Hetherington <cth@carlh.net>2025-05-08 22:24:14 +0200
commite80119614a0975de33ed8a370fbfe60a2a915b1e (patch)
tree87831501e818b34fb8d814fb97f864aa0cb6fbe0 /src/verify_internal.h
parent54953e5f759374de8f99dd83ab47030c38dd7f0e (diff)
Only check hashes of each asset once (#3035).v1.10.21
Diffstat (limited to 'src/verify_internal.h')
-rw-r--r--src/verify_internal.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/verify_internal.h b/src/verify_internal.h
index 97c0e90f..d6e3c075 100644
--- a/src/verify_internal.h
+++ b/src/verify_internal.h
@@ -49,6 +49,7 @@
#include <boost/filesystem.hpp>
#include <boost/optional.hpp>
#include <memory>
+#include <unordered_set>
#include <vector>
@@ -131,6 +132,13 @@ public:
}
}
+ bool should_verify_asset(std::string const& id)
+ {
+ auto const should = verified_assets.find(id) == verified_assets.end();
+ verified_assets.insert(id);
+ return should;
+ }
+
std::vector<VerificationNote>& notes;
std::shared_ptr<const DCP> dcp;
std::shared_ptr<const CPL> cpl;
@@ -138,6 +146,8 @@ public:
std::function<void (std::string, boost::optional<boost::filesystem::path>)> stage;
std::function<void (float)> progress;
VerificationOptions options;
+ /** IDs of assets that have already been verified and need not be checked again */
+ std::unordered_set<std::string> verified_assets;
boost::optional<std::string> subtitle_language;
boost::optional<int> audio_channels;