diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-02 10:59:16 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-02 10:59:16 +0100 |
| commit | ddad6389ba1971603a3dbf975b1e5fae95ce6bd6 (patch) | |
| tree | 613acd994ef5de594d4ec8a8e15f84a7e7c60f18 /src | |
| parent | 2ab331e925eda5f2cc0d8bc3862e46bea60989b6 (diff) | |
Speed up referencing of existing DCPs.
When referring to an existing DCP, assume that the hash in the CPL
is correct rather than recalculating it. This can be a big benefit
when, for example, referring to an existing picture MXF.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/reel_writer.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index d707550bb..bc0013ff1 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -329,6 +329,10 @@ ReelWriter::create_reel (list<ReferencedReelAsset> const & refs, list<shared_ptr } reel->add (reel_picture_asset); + /* If we have a hash for this asset in the CPL, assume that it is correct */ + if (reel_picture_asset->hash()) { + reel_picture_asset->asset_ref()->set_hash (reel_picture_asset->hash().get()); + } if (_sound_asset) { /* We have made a sound asset of our own. Put it into the reel */ @@ -339,6 +343,10 @@ ReelWriter::create_reel (list<ReferencedReelAsset> const & refs, list<shared_ptr shared_ptr<dcp::ReelSoundAsset> k = dynamic_pointer_cast<dcp::ReelSoundAsset> (j.asset); if (k && j.period == _period) { reel->add (k); + /* If we have a hash for this asset in the CPL, assume that it is correct */ + if (k->hash()) { + k->asset_ref()->set_hash (k->hash().get()); + } } } } @@ -397,6 +405,10 @@ ReelWriter::create_reel (list<ReferencedReelAsset> const & refs, list<shared_ptr shared_ptr<dcp::ReelSubtitleAsset> k = dynamic_pointer_cast<dcp::ReelSubtitleAsset> (j.asset); if (k && j.period == _period) { reel->add (k); + /* If we have a hash for this asset in the CPL, assume that it is correct */ + if (k->hash()) { + k->asset_ref()->set_hash (k->hash().get()); + } } } } |
