Re-transcode and re-check J2Ks after a bad one is found.
[dcpomatic.git] / src / lib / transcode_job.cc
index 652a184419892164acc816b299db7fcfe95b0356..9113593f0c1976c4967df5df7e9c7bea509d38d4 100644 (file)
@@ -78,7 +78,6 @@ TranscodeJob::run ()
                _log->log (s.str ());
 
                throw;
-
        }
 }
 
@@ -88,13 +87,30 @@ TranscodeJob::status () const
        if (!_encoder) {
                return "0%";
        }
+
+       if (_encoder->skipping () && !finished ()) {
+               return "skipping already-encoded frames";
+       }
+               
        
        float const fps = _encoder->current_frames_per_second ();
        if (fps == 0) {
                return Job::status ();
        }
-               
+
        stringstream s;
-       s << Job::status () << "; about " << fixed << setprecision (1) << fps << " frames per second.";
+
+       s << Job::status () << "; " << fixed << setprecision (1) << fps << " frames per second";
        return s.str ();
 }
+
+int
+TranscodeJob::remaining_time () const
+{
+       float fps = _encoder->current_frames_per_second ();
+       if (fps == 0) {
+               return 0;
+       }
+
+       return ((_fs->length - _encoder->last_frame()) / fps);
+}