summaryrefslogtreecommitdiff
path: root/src/lib/encoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-08-29 14:50:55 +0100
committerCarl Hetherington <cth@carlh.net>2013-08-29 14:50:55 +0100
commitb8724f408298ff3e804fb821fa15d3bcded0e3db (patch)
tree6b551ad6a7bc2845f105a5f44bc5151d9e600d1a /src/lib/encoder.cc
parente60d69b3462755c5f98a460688d391822fdc62fb (diff)
parent11619ba7fd5537407798c01c6ca299fb64422338 (diff)
Merge branch '1.0' of /home/carl/git/dvdomatic into 1.0
Diffstat (limited to 'src/lib/encoder.cc')
-rw-r--r--src/lib/encoder.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc
index ea175f1f4..35ebfb52e 100644
--- a/src/lib/encoder.cc
+++ b/src/lib/encoder.cc
@@ -52,6 +52,7 @@ Encoder::Encoder (shared_ptr<const Film> f, shared_ptr<Job> j)
: _film (f)
, _job (j)
, _video_frames_out (0)
+ , _state (TRANSCODING)
, _terminate (false)
{
_have_a_real_frame[EYES_BOTH] = false;
@@ -125,6 +126,11 @@ Encoder::process_end ()
}
}
+ {
+ boost::mutex::scoped_lock lm (_state_mutex);
+ _state = HASHING;
+ }
+
_writer->finish ();
_writer.reset ();
}
@@ -135,7 +141,7 @@ Encoder::process_end ()
float
Encoder::current_encoding_rate () const
{
- boost::mutex::scoped_lock lock (_history_mutex);
+ boost::mutex::scoped_lock lock (_state_mutex);
if (int (_time_history.size()) < _history_size) {
return 0;
}
@@ -150,7 +156,7 @@ Encoder::current_encoding_rate () const
int
Encoder::video_frames_out () const
{
- boost::mutex::scoped_lock (_history_mutex);
+ boost::mutex::scoped_lock (_state_mutex);
return _video_frames_out;
}
@@ -160,7 +166,7 @@ Encoder::video_frames_out () const
void
Encoder::frame_done ()
{
- boost::mutex::scoped_lock lock (_history_mutex);
+ boost::mutex::scoped_lock lock (_state_mutex);
struct timeval tv;
gettimeofday (&tv, 0);