X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fencoder.cc;h=ed14f2755f5798013d20ae1048118e7f2e985f1d;hb=75cd462257fbec6c6998f2d1339e37ab4ff16f31;hp=f3745ff98aad53da45e403109518bac768ed29ba;hpb=a0856e3fbef17f24073b01cb96be6bbcb229ecbc;p=dcpomatic.git diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index f3745ff98..ed14f2755 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -40,6 +40,7 @@ using std::stringstream; using std::vector; using std::list; using std::cout; +using std::min; using std::make_pair; using boost::shared_ptr; using boost::optional; @@ -47,7 +48,7 @@ using boost::optional; int const Encoder::_history_size = 25; /** @param f Film that we are encoding */ -Encoder::Encoder (shared_ptr f, shared_ptr j) +Encoder::Encoder (shared_ptr f, shared_ptr j) : _film (f) , _job (j) , _video_frames_out (0) @@ -169,7 +170,7 @@ Encoder::frame_done () } void -Encoder::process_video (shared_ptr image, bool same, Time) +Encoder::process_video (shared_ptr image, bool same) { boost::mutex::scoped_lock lock (_mutex); @@ -199,7 +200,6 @@ Encoder::process_video (shared_ptr image, bool same, Time) } else { /* Queue this new frame for encoding */ TIMING ("adding to queue of %1", _queue.size ()); - /* XXX: padding */ _queue.push_back (shared_ptr ( new DCPVideoFrame ( image, _video_frames_out, _film->dcp_video_frame_rate(), @@ -215,7 +215,7 @@ Encoder::process_video (shared_ptr image, bool same, Time) } void -Encoder::process_audio (shared_ptr data, Time) +Encoder::process_audio (shared_ptr data) { _writer->write (data); } @@ -234,6 +234,8 @@ Encoder::terminate_threads () } delete *i; } + + _threads.clear (); } void