summaryrefslogtreecommitdiff
path: root/src/lib/writer.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-05-08 20:37:53 +0100
committerCarl Hetherington <cth@carlh.net>2013-05-08 20:37:53 +0100
commitfd040c2bd27fde35424a384174ecb56c643764cd (patch)
tree074906414d27d93a21224f110129a7e857a6ee04 /src/lib/writer.cc
parent72d36df1174810d8d871a06d085b81b1652edf67 (diff)
Some tidying up. Do encode progress in the writer to improve progress bar movement with still-image DCPs (#130).
Diffstat (limited to 'src/lib/writer.cc')
-rw-r--r--src/lib/writer.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index b545848cb..c7d2cf8b4 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -34,6 +34,7 @@
#include "player.h"
#include "audio_mapping.h"
#include "config.h"
+#include "job.h"
#include "i18n.h"
@@ -47,8 +48,9 @@ using boost::shared_ptr;
int const Writer::_maximum_frames_in_memory = 8;
-Writer::Writer (shared_ptr<Film> f)
+Writer::Writer (shared_ptr<Film> f, shared_ptr<Job> j)
: _film (f)
+ , _job (j)
, _first_nonexistant_frame (0)
, _thread (0)
, _finish (false)
@@ -202,6 +204,10 @@ try
}
}
lock.lock ();
+
+ if (_film->video_length ()) {
+ _job->set_progress (float(_full_written + _fake_written + _repeat_written) / _film->video_length());
+ }
++_last_written_frame;
}