Merge 1.0 and some subtitling fixes.
[dcpomatic.git] / src / lib / job.cc
index 5fbd1a160e49622007fbcbb3ac346f4bfdf2f83c..05a90524c9818615112b77464da5a56bd154ec69 100644 (file)
@@ -189,6 +189,7 @@ Job::set_state (State s)
                if (_state == FINISHED_OK || _state == FINISHED_ERROR || _state == FINISHED_CANCELLED) {
                        _ran_for = elapsed_time ();
                        finished = true;
+                       _sub_name.clear ();
                }
        }
 
@@ -197,7 +198,7 @@ Job::set_state (State s)
        }
 }
 
-/** @return Time (in seconds) that this sub-job has been running */
+/** @return DCPTime (in seconds) that this sub-job has been running */
 int
 Job::elapsed_time () const
 {
@@ -212,9 +213,9 @@ Job::elapsed_time () const
  *  @param p Progress (from 0 to 1)
  */
 void
-Job::set_progress (float p)
+Job::set_progress (float p, bool force)
 {
-       if (fabs (p - progress()) < 0.01) {
+       if (!force && fabs (p - progress()) < 0.01) {
                /* Calm excessive progress reporting */
                return;
        }
@@ -248,7 +249,7 @@ Job::sub (string n)
                _sub_name = n;
        }
        
-       set_progress (0);
+       set_progress (0, true);
 }
 
 string