Fix typo preventing audio sync fixes when audio follows video.
[dcpomatic.git] / src / lib / job_manager.cc
index 1fae179656222b299192d71652ad5abe719ec844..9105976280dd3b7d5ab58f81a362bdb72dcf5a9d 100644 (file)
@@ -100,30 +100,30 @@ JobManager::scheduler ()
                {
                        boost::mutex::scoped_lock lm (_mutex);
                        for (list<shared_ptr<Job> >::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<Job> 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);