diff options
Diffstat (limited to 'src/lib/decoder.cc')
| -rw-r--r-- | src/lib/decoder.cc | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc index 32d0bab64..6da45a788 100644 --- a/src/lib/decoder.cc +++ b/src/lib/decoder.cc @@ -142,27 +142,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. @@ -265,6 +251,8 @@ Decoder::emit_audio (uint8_t* data, int size) void Decoder::process_video (AVFrame* frame) { + assert (_film->length()); + if (_minimal) { ++_video_frame_index; return; @@ -282,6 +270,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(); |
