Merge master branch.
[dcpomatic.git] / src / lib / check_hashes_job.cc
index 099845d8c7a94583b735354d416d3b94f6acef8c..55a744552162ff5b48153e4b32aeab87e9e4afb1 100644 (file)
@@ -34,9 +34,9 @@ using std::stringstream;
 using std::ifstream;
 using boost::shared_ptr;
 
-CheckHashesJob::CheckHashesJob (shared_ptr<Film> f, shared_ptr<const DecodeOptions> od, shared_ptr<Job> req)
+CheckHashesJob::CheckHashesJob (shared_ptr<Film> f, DecodeOptions o, shared_ptr<Job> req)
        : Job (f, req)
-       , _decode_opt (od)
+       , _decode_opt (o)
        , _bad (0)
 {
 
@@ -53,16 +53,12 @@ CheckHashesJob::run ()
 {
        _bad = 0;
 
-       if (!_film->dcp_length()) {
-               throw EncodeError ("cannot check hashes of a DCP with unknown length");
+       if (!_film->dcp_intrinsic_duration()) {
+               throw EncodeError ("cannot check hashes of a DCP with unknown intrinsic duration");
        }
        
-       SourceFrame const N = _film->dcp_trim_start() + _film->dcp_length().get();
-       DCPFrameRate const dfr (_film->frames_per_second ());
-
-       int const inc = dfr.skip ? 2 : 1;
-       
-       for (SourceFrame i = _film->dcp_trim_start(); i < N; i += inc) {
+       int const N = _film->dcp_intrinsic_duration().get();
+       for (int i = 0; i < N; ++i) {
                string const j2k_file = _film->frame_out_path (i, false);
                string const hash_file = _film->hash_out_path (i, false);