diff options
Diffstat (limited to 'src/lib/decoder.cc')
| -rw-r--r-- | src/lib/decoder.cc | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc index 3feaf43e9..a8da1ae67 100644 --- a/src/lib/decoder.cc +++ b/src/lib/decoder.cc @@ -140,27 +140,13 @@ Decoder::go () while (pass () == false) { if (_job && _film->dcp_length()) { - _job->set_progress (float (_video_frame_index) / _film->dcp_length().get()); + _job->set_progress (float ((_video_frame_index - _film->dcp_trim_start())) / _film->dcp_length().get()); } } process_end (); } -/** Run one pass. This may or may not generate any actual video / audio data; - * some decoders may require several passes to generate a single frame. - * @return true if we have finished processing all data; otherwise false. - */ -bool -Decoder::pass () -{ - if (!_ignore_length && _video_frame_index >= _film->dcp_length()) { - return true; - } - - return do_pass (); -} - /** Called by subclasses to tell the world that some audio data is ready * @param data Audio data, in Film::audio_sample_format. * @param size Number of bytes of data. @@ -263,6 +249,8 @@ Decoder::emit_audio (uint8_t* data, int size) void Decoder::process_video (AVFrame* frame) { + assert (_ignore_length || _film->length()); + if (_minimal) { ++_video_frame_index; return; @@ -275,6 +263,11 @@ Decoder::process_video (AVFrame* frame) return; } + if (_film->dcp_trim_start() > _video_frame_index || (_film->length().get() - _film->dcp_trim_end()) < _video_frame_index) { + ++_video_frame_index; + return; + } + shared_ptr<FilterGraph> graph; list<shared_ptr<FilterGraph> >::iterator i = _filter_graphs.begin(); @@ -293,10 +286,6 @@ Decoder::process_video (AVFrame* frame) list<shared_ptr<Image> > images = graph->process (frame); for (list<shared_ptr<Image> >::iterator i = images.begin(); i != images.end(); ++i) { - if (_opt->black_after > 0 && _video_frame_index > _opt->black_after) { - (*i)->make_black (); - } - shared_ptr<Subtitle> sub; if (_timed_subtitle && _timed_subtitle->displayed_at (double (video_frame_index()) / _film->frames_per_second())) { sub = _timed_subtitle->subtitle (); |
