diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-09 02:14:04 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-09 02:14:04 +0100 |
| commit | e73d64612c12f2027a91fa2061992aeec3c4bb60 (patch) | |
| tree | b45a2f520ac12318964f90bcaa78b469b2f4411a /src/lib | |
| parent | a78f48e77516d64f568cd6ea7c35b7095264b78c (diff) | |
Remove some unnecessary code.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/ab_transcoder.cc | 2 | ||||
| -rw-r--r-- | src/lib/decoder.cc | 17 | ||||
| -rw-r--r-- | src/lib/decoder.h | 2 | ||||
| -rw-r--r-- | src/lib/film.cc | 3 | ||||
| -rw-r--r-- | src/lib/options.h | 2 |
5 files changed, 4 insertions, 22 deletions
diff --git a/src/lib/ab_transcoder.cc b/src/lib/ab_transcoder.cc index 95492a9d8..1c20ae477 100644 --- a/src/lib/ab_transcoder.cc +++ b/src/lib/ab_transcoder.cc @@ -112,7 +112,7 @@ ABTranscoder::go () bool const b = _db->pass (); if (_job) { - _job->set_progress (float (_last_frame) / _da->decoding_frames ()); + _job->set_progress (float (_last_frame) / _fs_a->dcp_length()); } if (a && b) { diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc index 8aa5f77c6..324d1a296 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; } diff --git a/src/lib/decoder.h b/src/lib/decoder.h index 19ef25ede..04ff512eb 100644 --- a/src/lib/decoder.h +++ b/src/lib/decoder.h @@ -77,8 +77,6 @@ public: return _video_frame; } - int decoding_frames () const; - /** Emitted when a video frame is ready. * First parameter is the frame. * Second parameter is its index within the content. diff --git a/src/lib/film.cc b/src/lib/film.cc index 330ae9e5d..e2b3d4bc3 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -517,18 +517,15 @@ Film::make_dcp (bool transcode, int freq) o->out_size = format()->dcp_size (); if (dcp_frames() == 0) { /* Decode the whole film, no blacking */ - o->num_frames = 0; o->black_after = 0; } else { switch (dcp_trim_action()) { case CUT: /* Decode only part of the film, no blacking */ - o->num_frames = dcp_frames (); o->black_after = 0; break; case BLACK_OUT: /* Decode the whole film, but black some frames out */ - o->num_frames = 0; o->black_after = dcp_frames (); } } diff --git a/src/lib/options.h b/src/lib/options.h index b283e330d..1156ece1d 100644 --- a/src/lib/options.h +++ b/src/lib/options.h @@ -39,7 +39,6 @@ public: Options (std::string f, std::string e, std::string m) : padding (0) , apply_crop (true) - , num_frames (0) , decode_video (true) , decode_video_frequency (0) , decode_audio (true) @@ -93,7 +92,6 @@ public: float ratio; ///< ratio of the wanted output image (not considering padding) int padding; ///< number of pixels of padding (in terms of the output size) each side of the image bool apply_crop; ///< true to apply cropping - int num_frames; ///< number of video frames to run for, or 0 for all int black_after; ///< first frame for which to output a black frame, rather than the actual video content, or 0 for none bool decode_video; ///< true to decode video, otherwise false int decode_video_frequency; ///< skip frames so that this many are decoded in all (or 0) (for generating thumbnails) |
