X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcheck_hashes_job.cc;h=5a927f752bb5815517dfb488787545849884dbe3;hb=922361469072474da4294a90f1436cd0117cb90f;hp=87eb40d144a0a4926155b48b7aeab869d7f767a8;hpb=82af50304f55a961cba6afefbfa7edd5440bfcc4;p=dcpomatic.git diff --git a/src/lib/check_hashes_job.cc b/src/lib/check_hashes_job.cc index 87eb40d14..5a927f752 100644 --- a/src/lib/check_hashes_job.cc +++ b/src/lib/check_hashes_job.cc @@ -24,6 +24,9 @@ #include "film_state.h" #include "options.h" #include "log.h" +#include "job_manager.h" +#include "ab_transcode_job.h" +#include "transcode_job.h" using namespace std; using namespace boost; @@ -66,6 +69,19 @@ CheckHashesJob::run () set_progress (float (i) / _fs->length); } + if (_bad) { + shared_ptr tc; + + if (_fs->dcp_ab) { + tc.reset (new ABTranscodeJob (_fs, _opt, _log)); + } else { + tc.reset (new TranscodeJob (_fs, _opt, _log)); + } + + JobManager::instance()->add_after (shared_from_this(), tc); + JobManager::instance()->add_after (tc, shared_ptr (new CheckHashesJob (_fs, _opt, _log))); + } + set_progress (1); set_state (FINISHED_OK); } @@ -74,6 +90,15 @@ string CheckHashesJob::status () const { stringstream s; - s << Job::status () << "; " << _bad << " bad frames found"; + s << Job::status (); + if (overall_progress() > 0) { + if (_bad == 0) { + s << "; no bad frames found"; + } else if (_bad == 1) { + s << "; 1 bad frame found"; + } else { + s << "; " << _bad << " bad frames found"; + } + } return s.str (); }