diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-09 02:29:20 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-09 02:29:20 +0100 |
| commit | 9b0d04f34424c9aeddaf07007838f2c8c0113093 (patch) | |
| tree | fdc64213467df44f4aaadaad77557ac378b63658 /src/lib/decoder.cc | |
| parent | 6fd70950e721181920603d90ad52ed58883f2806 (diff) | |
| parent | e73d64612c12f2027a91fa2061992aeec3c4bb60 (diff) | |
Merge branch 'master' into subs
Diffstat (limited to 'src/lib/decoder.cc')
| -rw-r--r-- | src/lib/decoder.cc | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc index 44079edf7..15d74022c 100644 --- a/src/lib/decoder.cc +++ b/src/lib/decoder.cc @@ -112,7 +112,7 @@ Decoder::process_end () */ int64_t const audio_short_by_frames = - ((int64_t) decoding_frames() * _fs->target_sample_rate() / _fs->frames_per_second) + ((int64_t) _fs->dcp_length() * _fs->target_sample_rate() / _fs->frames_per_second) - _audio_frames_processed; if (audio_short_by_frames >= 0) { @@ -147,24 +147,13 @@ Decoder::go () while (pass () == false) { if (_job && !_ignore_length) { - _job->set_progress (float (_video_frame) / decoding_frames ()); + _job->set_progress (float (_video_frame) / _fs->dcp_length()); } } process_end (); } -/** @return Number of frames that we will be decoding */ -int -Decoder::decoding_frames () const -{ - if (_opt->num_frames > 0) { - return _opt->num_frames; - } - - return _fs->length; -} - /** 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. @@ -177,7 +166,7 @@ Decoder::pass () _have_setup_video_filters = true; } - if (_opt->num_frames != 0 && _video_frame >= _opt->num_frames) { + if (_video_frame >= _fs->dcp_length()) { return true; } |
