X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcheck_hashes_job.cc;h=55a744552162ff5b48153e4b32aeab87e9e4afb1;hb=420adb1fd2910fd24eb84be98169afc209f76a0e;hp=d1483933d3e0172707cf20772f3defe9781855dc;hpb=d9f9938c2ca2a1f9b27a85bf64a50d7f480f969b;p=dcpomatic.git diff --git a/src/lib/check_hashes_job.cc b/src/lib/check_hashes_job.cc index d1483933d..55a744552 100644 --- a/src/lib/check_hashes_job.cc +++ b/src/lib/check_hashes_job.cc @@ -34,9 +34,9 @@ using std::stringstream; using std::ifstream; using boost::shared_ptr; -CheckHashesJob::CheckHashesJob (shared_ptr f, shared_ptr o, shared_ptr req) +CheckHashesJob::CheckHashesJob (shared_ptr f, DecodeOptions o, shared_ptr req) : Job (f, req) - , _opt (o) + , _decode_opt (o) , _bad (0) { @@ -53,16 +53,14 @@ 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"); } - int const N = _film->dcp_length().get(); - DCPFrameRate const dfr = dcp_frame_rate (_film->frames_per_second ()); - - for (int i = 0; i < N; i += dfr.skip) { - string const j2k_file = _opt->frame_out_path (i, false); - string const hash_file = j2k_file + ".md5"; + 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); if (!boost::filesystem::exists (j2k_file)) { _film->log()->log (String::compose ("Frame %1 has a missing J2K file.", i)); @@ -91,13 +89,13 @@ CheckHashesJob::run () shared_ptr tc; if (_film->dcp_ab()) { - tc.reset (new ABTranscodeJob (_film, _opt, shared_from_this())); + tc.reset (new ABTranscodeJob (_film, _decode_opt, shared_from_this())); } else { - tc.reset (new TranscodeJob (_film, _opt, shared_from_this())); + tc.reset (new TranscodeJob (_film, _decode_opt, shared_from_this())); } JobManager::instance()->add_after (shared_from_this(), tc); - JobManager::instance()->add_after (tc, shared_ptr (new CheckHashesJob (_film, _opt, tc))); + JobManager::instance()->add_after (tc, shared_ptr (new CheckHashesJob (_film, _decode_opt, tc))); } set_progress (1);