Fix ran-for display in makedcp.
authorCarl Hetherington <cth@carlh.net>
Mon, 1 Oct 2012 19:30:47 +0000 (20:30 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 1 Oct 2012 19:30:47 +0000 (20:30 +0100)
TODO
src/lib/job.cc
src/lib/job.h

diff --git a/TODO b/TODO
index 230d79821cd8c840536b08794477b6528a104338..83b9c3f92442e06347527effd3e90a3e484100c9 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,7 +1,12 @@
 EC2
 
 Small instance $0.085 ph
-Sintel Trailer 1080p @ 250000 Mbps
+Sintel Trailer 1080p @ 200000 Mbps
+1247 frames @ 24fps ie 51.96s
+Took 1h20 to encode
+
+Transfer in free
+Transfer out $0.120 per GB
 
 
 Port DVD rip
index 22754eb909659ffd8693b48c77a9c184b6c40f9b..e78a9131581e6183ceefc2fb96ac20a4b28f421e 100644 (file)
@@ -41,6 +41,7 @@ Job::Job (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l)
        , _state (NEW)
        , _start_time (0)
        , _progress_unknown (false)
+       , _ran_for (0)
 {
        assert (_log);
        
@@ -121,6 +122,10 @@ Job::set_state (State s)
 {
        boost::mutex::scoped_lock lm (_state_mutex);
        _state = s;
+
+       if (_state == FINISHED_OK || _state == FINISHED_ERROR) {
+               _ran_for = elapsed_time ();
+       }
 }
 
 /** A hack to work around our lack of cross-thread
@@ -245,7 +250,7 @@ Job::status () const
        } else if (!finished () && (t <= 10 || r == 0)) {
                s << rint (p * 100) << "%";
        } else if (finished_ok ()) {
-               s << "OK (ran for " << seconds_to_hms (t) << ")";
+               s << "OK (ran for " << seconds_to_hms (_ran_for) << ")";
        } else if (finished_in_error ()) {
                s << "Error (" << error() << ")";
        }
index b391304792e0a3e9ab0a926ae440b3dfcf806e8d..802bf468da24d71a723fc31929d1fcdd0810cca0 100644 (file)
@@ -119,6 +119,8 @@ private:
 
        /** true if this job's progress will always be unknown */
        bool _progress_unknown;
+
+       int _ran_for;
 };
 
 #endif