X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fencoder.cc;h=4dff19ea6dbd8bc93f0fd7573c77cc206e6768e5;hb=883d885dc8690519d205c8baa275385af8a39f4b;hp=f91a2c4e20e3929867428c265fa139ad5b8e62c0;hpb=d683883c4dc25cb612f6d5feb1e772016182e722;p=dcpomatic.git diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index f91a2c4e2..4dff19ea6 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" @@ -58,7 +50,6 @@ int const Encoder::_history_size = 25; Encoder::Encoder (shared_ptr f, shared_ptr j) : _film (f) , _job (j) - , _video_frames_in (0) , _video_frames_out (0) , _have_a_real_frame (false) , _terminate (false) @@ -178,15 +169,8 @@ Encoder::frame_done () } void -Encoder::process_video (shared_ptr image, bool same, shared_ptr sub) +Encoder::process_video (shared_ptr image, bool same, Time) { - FrameRateConversion frc (_film->video_frame_rate(), _film->dcp_frame_rate()); - - if (frc.skip && (_video_frames_in % 2)) { - ++_video_frames_in; - return; - } - boost::mutex::scoped_lock lock (_mutex); /* Wait until the queue has gone down a bit */ @@ -214,15 +198,12 @@ 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 ()); + /* XXX: padding */ _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_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() ) )); @@ -230,18 +211,11 @@ Encoder::process_video (shared_ptr image, bool same, shared_ptrrepeat (_video_frames_out); - ++_video_frames_out; - frame_done (); - } } void -Encoder::process_audio (shared_ptr data) +Encoder::process_audio (shared_ptr data, Time) { _writer->write (data); } @@ -260,6 +234,8 @@ Encoder::terminate_threads () } delete *i; } + + _threads.clear (); } void