Merge master into direct-mxf.
[dcpomatic.git] / src / lib / examine_content_job.cc
index 70a04b8255059262ec0de2fc8e0c929a277b6702..69a757e2b94bb65ad5f37128fb2c896386011f51 100644 (file)
@@ -59,7 +59,11 @@ ExamineContentJob::name () const
 void
 ExamineContentJob::run ()
 {
-       descend (1);
+       descend (0.5);
+       _film->set_content_digest (md5_digest (_film->content_path ()));
+       ascend ();
+
+       descend (0.5);
 
        /* Set the film's length to either
           a) a length judged by running through the content or
@@ -74,8 +78,8 @@ ExamineContentJob::run ()
                _film->unset_length ();
                _film->set_crop (Crop ());
                
-               shared_ptr<DecodeOptions> o (new DecodeOptions);
-               o->decode_audio = false;
+               DecodeOptions o;
+               o.decode_audio = false;
                
                Decoders decoders = decoder_factory (_film, o, this);
                
@@ -92,8 +96,7 @@ ExamineContentJob::run ()
 
                /* Get a quick decoder to get the content's length from its header */
                
-               shared_ptr<DecodeOptions> o (new DecodeOptions);
-               Decoders d = decoder_factory (_film, o, 0);
+               Decoders d = decoder_factory (_film, DecodeOptions(), 0);
                _film->set_length (d.video->length());
        
                _film->log()->log (String::compose ("Video length obtained from header as %1 frames", _film->length().get()));