diff options
Diffstat (limited to 'src/lib/check_hashes_job.cc')
| -rw-r--r-- | src/lib/check_hashes_job.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/check_hashes_job.cc b/src/lib/check_hashes_job.cc index 88233ab66..a9f8ac90b 100644 --- a/src/lib/check_hashes_job.cc +++ b/src/lib/check_hashes_job.cc @@ -27,6 +27,7 @@ #include "ab_transcode_job.h" #include "transcode_job.h" #include "film.h" +#include "exceptions.h" using std::string; using std::stringstream; @@ -52,7 +53,11 @@ CheckHashesJob::run () { _bad = 0; - int const N = _film->dcp_length (); + if (!_film->dcp_length()) { + throw EncodeError ("cannot check hashes of a DCP with unknown length"); + } + + int const N = _film->dcp_length().get(); for (int i = 0; i < N; ++i) { string const j2k_file = _opt->frame_out_path (i, false); @@ -78,7 +83,7 @@ CheckHashesJob::run () } } - set_progress (float (i) / _film->length()); + set_progress (float (i) / N); } if (_bad) { |
