From: Carl Hetherington Date: Thu, 2 Jun 2016 09:59:16 +0000 (+0100) Subject: Speed up referencing of existing DCPs. X-Git-Tag: v2.8.7~3 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=ddad6389ba1971603a3dbf975b1e5fae95ce6bd6 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. --- 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 const & refs, listadd (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 const & refs, list k = dynamic_pointer_cast (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 const & refs, list k = dynamic_pointer_cast (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()); + } } } }