summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-10-01 20:30:47 +0100
committerCarl Hetherington <cth@carlh.net>2012-10-01 20:30:47 +0100
commit4ca2fcc360bbae05e896590fd53327616f9bd2a5 (patch)
tree265b911ab95bfaa9455cda3d8fda70322d126aca
parent50013be8d2c5edcfbf253459b2754eaaf675ed1d (diff)
Fix ran-for display in makedcp.
-rw-r--r--TODO7
-rw-r--r--src/lib/job.cc7
-rw-r--r--src/lib/job.h2
3 files changed, 14 insertions, 2 deletions
diff --git a/TODO b/TODO
index 230d79821..83b9c3f92 100644
--- 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
diff --git a/src/lib/job.cc b/src/lib/job.cc
index 22754eb90..e78a91315 100644
--- a/src/lib/job.cc
+++ b/src/lib/job.cc
@@ -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() << ")";
}
diff --git a/src/lib/job.h b/src/lib/job.h
index b39130479..802bf468d 100644
--- a/src/lib/job.h
+++ b/src/lib/job.h
@@ -119,6 +119,8 @@ private:
/** true if this job's progress will always be unknown */
bool _progress_unknown;
+
+ int _ran_for;
};
#endif