From 752bba7eb39d6f775a3ecb3ca3e19d7884626a4e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 4 Nov 2012 17:09:43 +0000 Subject: Revert "Remove minimal flag." This reverts commit ac712b45bad948fc8f38cf4fa48a529f2024c7f5. --- src/lib/decoder.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/lib/decoder.cc') diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc index 34c04b260..ee2beb3f3 100644 --- a/src/lib/decoder.cc +++ b/src/lib/decoder.cc @@ -46,11 +46,14 @@ using boost::shared_ptr; /** @param f Film. * @param o Options. * @param j Job that we are running within, or 0 + * @param minimal true to do the bare minimum of work; just run through the content. Useful for acquiring + * accurate frame counts as quickly as possible. This generates no video or audio output. */ -Decoder::Decoder (boost::shared_ptr f, boost::shared_ptr o, Job* j) +Decoder::Decoder (boost::shared_ptr f, boost::shared_ptr o, Job* j, bool minimal) : _film (f) , _opt (o) , _job (j) + , _minimal (minimal) , _video_frame_index (0) , _delay_line (0) , _delay_in_bytes (0) @@ -247,6 +250,11 @@ Decoder::process_video (AVFrame* frame) { assert (_film->length()); + if (_minimal) { + ++_video_frame_index; + return; + } + /* Use Film::length here as our one may be wrong */ if (_opt->decode_video_skip != 0 && (_video_frame_index % _opt->decode_video_skip) != 0) { -- cgit v1.2.3