diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-11-04 17:09:43 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-11-04 17:09:43 +0000 |
| commit | 752bba7eb39d6f775a3ecb3ca3e19d7884626a4e (patch) | |
| tree | 235b558aec10da89dca7484686ff035cbef4811c /src/lib/decoder.cc | |
| parent | ac712b45bad948fc8f38cf4fa48a529f2024c7f5 (diff) | |
Revert "Remove minimal flag."
This reverts commit ac712b45bad948fc8f38cf4fa48a529f2024c7f5.
Diffstat (limited to 'src/lib/decoder.cc')
| -rw-r--r-- | src/lib/decoder.cc | 10 |
1 files changed, 9 insertions, 1 deletions
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<Film> f, boost::shared_ptr<const Options> o, Job* j) +Decoder::Decoder (boost::shared_ptr<Film> f, boost::shared_ptr<const Options> 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) { |
