diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-02 09:20:19 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-02 09:20:19 +0100 |
| commit | 4da794a09e4e3114fea02f955e485ae5a5ca2dd7 (patch) | |
| tree | 7095a16aa5249dd6e8234ffcf073bb1893c95e81 /src/reel_asset.h | |
| parent | 51919d468831a876f31d5a6e2b25f8913314770d (diff) | |
Various tweaks to ReelAsset hashes.
Make ReelAsset::_hash optional. When writing the ReelAsset to the
CPL, use _hash rather than re-fetching it from the asset. Provide
accessor for _hash.
Diffstat (limited to 'src/reel_asset.h')
| -rw-r--r-- | src/reel_asset.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/reel_asset.h b/src/reel_asset.h index a90436a8..eea60fc8 100644 --- a/src/reel_asset.h +++ b/src/reel_asset.h @@ -84,6 +84,13 @@ public: return _duration; } + /** @return the asset's hash, if this ReelAsset has been created from one, + * otherwise the hash written to the CPL for this asset (if present). + */ + boost::optional<std::string> hash () const { + return _hash; + } + protected: template <class T> @@ -117,7 +124,8 @@ private: int64_t _intrinsic_duration; ///< The <IntrinsicDuration> from the reel's entry for this asset int64_t _entry_point; ///< The <EntryPoint> from the reel's entry for this asset int64_t _duration; ///< The <Duration> from the reel's entry for this asset - std::string _hash; ///< The <Hash> from the reel's entry for this asset + /** Either our asset's computed hash or the hash read in from the CPL, if it's present */ + boost::optional<std::string> _hash; }; } |
