X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fjob_manager.cc;h=9105976280dd3b7d5ab58f81a362bdb72dcf5a9d;hb=ba0a895137b630f5d308b123ef886d68090f855d;hp=1fae179656222b299192d71652ad5abe719ec844;hpb=110d7d4e111c2db31489296587d855328c5d8b34;p=dcpomatic.git diff --git a/src/lib/job_manager.cc b/src/lib/job_manager.cc index 1fae17965..910597628 100644 --- a/src/lib/job_manager.cc +++ b/src/lib/job_manager.cc @@ -100,30 +100,30 @@ JobManager::scheduler () { boost::mutex::scoped_lock lm (_mutex); for (list >::iterator i = _jobs.begin(); i != _jobs.end(); ++i) { + + if (!(*i)->finished ()) { + active_jobs = true; + } + if ((*i)->running ()) { /* Something is already happening */ break; } if ((*i)->is_new()) { - shared_ptr r = (*i)->required (); - if (!r || r->finished_ok ()) { - (*i)->start (); - - /* Only start one job at once */ - break; - } - } - - if (!(*i)->finished ()) { - active_jobs = true; + (*i)->start (); + + /* Only start one job at once */ + break; } } } if (active_jobs != _last_active_jobs) { _last_active_jobs = active_jobs; - ui_signaller->emit (boost::bind (boost::ref (ActiveJobsChanged), active_jobs)); + if (ui_signaller) { + ui_signaller->emit (boost::bind (boost::ref (ActiveJobsChanged), active_jobs)); + } } dvdomatic_sleep (1);