Try to improve progress reporting when doing image/sound digests.
authorCarl Hetherington <cth@carlh.net>
Tue, 5 Jul 2016 15:04:54 +0000 (16:04 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 5 Jul 2016 15:04:54 +0000 (16:04 +0100)
src/lib/job.cc
src/lib/transcode_job.cc

index 0699c532c0fa4c69582bf954efa194b9b1ebcce4..9d1b25867bae3b3b07a4056dbf891f096cf0b9d4 100644 (file)
@@ -324,6 +324,7 @@ Job::sub (string n)
        }
 
        set_progress (0, true);
+       _start_time = time (0);
 }
 
 string
index 7144f70d5127242fd7dca122e94713f1b761d2ff..fe7132699cdda7509b5b5420c3a0200957e13a9b 100644 (file)
@@ -133,10 +133,13 @@ TranscodeJob::remaining_time () const
        /* _transcoder might be destroyed by the job-runner thread */
        shared_ptr<Transcoder> t = _transcoder;
 
-       if (!t) {
-               return 0;
+       if (!t || t->finishing()) {
+               /* We aren't doing any actual encoding so just use the job's guess */
+               return Job::remaining_time ();
        }
 
+       /* We're encoding so guess based on the current encoding rate */
+
        float fps = t->current_encoding_rate ();
 
        if (fps == 0) {