Remove unused ignore_length parameter.
authorCarl Hetherington <cth@carlh.net>
Sun, 4 Nov 2012 16:55:50 +0000 (16:55 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 4 Nov 2012 16:55:50 +0000 (16:55 +0000)
src/lib/decoder.cc
src/lib/decoder.h
src/lib/decoder_factory.cc
src/lib/decoder_factory.h
src/lib/examine_content_job.cc
src/lib/ffmpeg_decoder.cc
src/lib/ffmpeg_decoder.h
src/lib/imagemagick_decoder.cc
src/lib/imagemagick_decoder.h
src/lib/tiff_decoder.cc
src/lib/tiff_decoder.h

index 3e210c9ccb63feb9ab417aebafcadbd87277d1d6..ee2beb3f3ce4c52eb766da6da22afd4c8a9a6bbb 100644 (file)
@@ -48,14 +48,12 @@ using boost::shared_ptr;
  *  @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.
- *  @param ignore_length Ignore the content's claimed length when computing progress.
  */
-Decoder::Decoder (boost::shared_ptr<Film> f, boost::shared_ptr<const Options> o, Job* j, bool minimal, bool ignore_length)
+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)
-       , _ignore_length (ignore_length)
        , _video_frame_index (0)
        , _delay_line (0)
        , _delay_in_bytes (0)
@@ -250,7 +248,7 @@ Decoder::emit_audio (uint8_t* data, int size)
 void
 Decoder::process_video (AVFrame* frame)
 {
-       assert (_ignore_length || _film->length());
+       assert (_film->length());
        
        if (_minimal) {
                ++_video_frame_index;
index 0741c4f54e4578d6f6069ef6e1de7b7c9be044c9..5750858dfea2efb75c84c0a1cb9df42bc2102eff 100644 (file)
@@ -52,7 +52,7 @@ class FilterGraph;
 class Decoder
 {
 public:
-       Decoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *, bool, bool);
+       Decoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *, bool);
        virtual ~Decoder ();
 
        /* Methods to query our input video */
@@ -126,9 +126,6 @@ protected:
         */
        bool _minimal;
 
-       /** ignore_length Ignore the content's claimed length when computing progress */
-       bool _ignore_length;
-
 private:
        void emit_audio (uint8_t* data, int size);
        
index 06377e26c4cb6b476a273ccc0034d4df44dbaac5..287bba0da9b1759a638e9317be188c14d2ff764f 100644 (file)
@@ -32,20 +32,17 @@ using boost::shared_ptr;
 
 shared_ptr<Decoder>
 decoder_factory (
-       shared_ptr<Film> f, shared_ptr<const Options> o, Job* j, bool minimal = false, bool ignore_length = false
+       shared_ptr<Film> f, shared_ptr<const Options> o, Job* j, bool minimal = false
        )
 {
        if (boost::filesystem::is_directory (f->content_path ())) {
                /* Assume a directory contains TIFFs */
-               return shared_ptr<Decoder> (new TIFFDecoder (f, o, j, minimal, ignore_length));
+               return shared_ptr<Decoder> (new TIFFDecoder (f, o, j, minimal));
        }
 
        if (f->content_type() == STILL) {
-               /* Always ignore length of decodes of stills, since the decoder finishes very quickly
-                  and it's the encoder that takes the time.
-               */
-               return shared_ptr<Decoder> (new ImageMagickDecoder (f, o, j, minimal, true));
+               return shared_ptr<Decoder> (new ImageMagickDecoder (f, o, j, minimal));
        }
        
-       return shared_ptr<Decoder> (new FFmpegDecoder (f, o, j, minimal, ignore_length));
+       return shared_ptr<Decoder> (new FFmpegDecoder (f, o, j, minimal));
 }
index 81dcec9441043cb1e69ebf946f7b9693fc28f0f5..b86c60c70f224b1f9b5a7825efb8541388aa2aae 100644 (file)
@@ -28,5 +28,5 @@ class Job;
 class Log;
 
 extern boost::shared_ptr<Decoder> decoder_factory (
-       boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *, bool minimal = false, bool ignore_length = false
+       boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *, bool minimal = false
        );
index 58b9282b85e5cb97cba26702cf6fdf2562d7d296..ec0d2409bb5fc059c597cdfa1f8bec3866ca5841 100644 (file)
@@ -66,7 +66,7 @@ ExamineContentJob::run ()
 
        descend (0.5);
 
-       _decoder = decoder_factory (_film, o, this, true, true);
+       _decoder = decoder_factory (_film, o, this, true);
        _decoder->go ();
 
        _film->set_length (_decoder->video_frame_index());
index 198925bd3a4285a9ed35e50a8ed2fff14de9bef4..f0e652cbe60663439c51b206547124e6378db478 100644 (file)
@@ -55,8 +55,8 @@ using std::vector;
 using std::stringstream;
 using boost::shared_ptr;
 
-FFmpegDecoder::FFmpegDecoder (shared_ptr<Film> f, shared_ptr<const Options> o, Job* j, bool minimal, bool ignore_length)
-       : Decoder (f, o, j, minimal, ignore_length)
+FFmpegDecoder::FFmpegDecoder (shared_ptr<Film> f, shared_ptr<const Options> o, Job* j, bool minimal)
+       : Decoder (f, o, j, minimal)
        , _format_context (0)
        , _video_stream (-1)
        , _audio_stream (-1)
index 3f96c1632545abacd6599b30853955876dcda98e..fbd9e5255b57342b7cc3ef3a9c66985b59a75b54 100644 (file)
@@ -52,7 +52,7 @@ class Log;
 class FFmpegDecoder : public Decoder
 {
 public:
-       FFmpegDecoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *, bool, bool);
+       FFmpegDecoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *, bool);
        ~FFmpegDecoder ();
 
        /* Methods to query our input video */
index 8abefdbb9938b873d001f86ed9fac54c262a0310..81349beca72e3ceb8a4ff37cd136698b78439140 100644 (file)
@@ -27,8 +27,8 @@ using namespace std;
 using namespace boost;
 
 ImageMagickDecoder::ImageMagickDecoder (
-       boost::shared_ptr<Film> f, boost::shared_ptr<const Options> o, Job* j, bool minimal, bool ignore_length)
-       : Decoder (f, o, j, minimal, ignore_length)
+       boost::shared_ptr<Film> f, boost::shared_ptr<const Options> o, Job* j, bool minimal)
+       : Decoder (f, o, j, minimal)
        , _done (false)
 {
        _magick_image = new Magick::Image (_film->content_path ());
index c8e47d47dc3ccef2de16accbafdd8892e637f622..85bcf4c5bc29811ee9acd36e0507315f10739dc4 100644 (file)
@@ -26,7 +26,7 @@ namespace Magick {
 class ImageMagickDecoder : public Decoder
 {
 public:
-       ImageMagickDecoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *, bool, bool);
+       ImageMagickDecoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *, bool);
 
        float frames_per_second () const {
                return static_frames_per_second ();
index 7d8559a7c5656c7add550abc1f9daf5625f5126e..2c050def67e8098e63056640fac2d095b7ad650d 100644 (file)
@@ -46,10 +46,9 @@ using namespace boost;
  *  @param j Job that we are associated with, 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.
- *  @param ignore_length Ignore the content's claimed length when computing progress.
  */
-TIFFDecoder::TIFFDecoder (boost::shared_ptr<Film> f, boost::shared_ptr<const Options> o, Job* j, bool minimal, bool ignore_length)
-       : Decoder (f, o, j, minimal, ignore_length)
+TIFFDecoder::TIFFDecoder (boost::shared_ptr<Film> f, boost::shared_ptr<const Options> o, Job* j, bool minimal)
+       : Decoder (f, o, j, minimal)
 {
        string const dir = _film->content_path ();
        
index 7bbff7dfed6bb59acfea86db824932d711c590b3..c02a1d03d72c7373f776b9c71408a0b70b9cb883 100644 (file)
@@ -42,7 +42,7 @@ class Image;
 class TIFFDecoder : public Decoder
 {
 public:
-       TIFFDecoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *, bool, bool);
+       TIFFDecoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *, bool);
 
        /* Methods to query our input video */
        float frames_per_second () const;