X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fencoder.cc;h=ed14f2755f5798013d20ae1048118e7f2e985f1d;hb=75cd462257fbec6c6998f2d1339e37ab4ff16f31;hp=95e98ab760cecb9abbd681840a69b946d2bacbfb;hpb=237a0052c60af768f4d62b00321932918b7ba4d9;p=dcpomatic.git diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index 95e98ab76..ed14f2755 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -22,23 +22,15 @@ */ #include -#include -#include -#include #include "encoder.h" #include "util.h" #include "film.h" #include "log.h" -#include "exceptions.h" -#include "filter.h" #include "config.h" #include "dcp_video_frame.h" #include "server.h" -#include "format.h" #include "cross.h" #include "writer.h" -#include "player.h" -#include "audio_mapping.h" #include "i18n.h" @@ -48,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; @@ -55,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) @@ -177,7 +170,7 @@ Encoder::frame_done () } void -Encoder::process_video (shared_ptr image, bool same, shared_ptr sub, Time) +Encoder::process_video (shared_ptr image, bool same) { boost::mutex::scoped_lock lock (_mutex); @@ -206,15 +199,11 @@ Encoder::process_video (shared_ptr image, bool same, shared_ptr const s = Filter::ffmpeg_strings (_film->filters()); TIMING ("adding to queue of %1", _queue.size ()); _queue.push_back (shared_ptr ( new DCPVideoFrame ( - image, sub, _film->format()->dcp_size(), _film->format()->dcp_padding (_film), - _film->subtitle_offset(), _film->subtitle_scale(), - _film->scaler(), _video_frames_out, _film->dcp_video_frame_rate(), s.second, - _film->colour_lut(), _film->j2k_bandwidth(), - _film->log() + image, _video_frames_out, _film->dcp_video_frame_rate(), + _film->colour_lut(), _film->j2k_bandwidth(), _film->log() ) )); @@ -226,7 +215,7 @@ Encoder::process_video (shared_ptr image, bool same, shared_ptr data, Time) +Encoder::process_audio (shared_ptr data) { _writer->write (data); } @@ -245,6 +234,8 @@ Encoder::terminate_threads () } delete *i; } + + _threads.clear (); } void