Fix up parent / child member naming confusion.
authorCarl Hetherington <cth@carlh.net>
Wed, 31 Oct 2012 01:53:44 +0000 (01:53 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 31 Oct 2012 01:53:44 +0000 (01:53 +0000)
src/lib/decoder.cc
src/lib/decoder.h
src/lib/examine_content_job.cc
src/lib/ffmpeg_decoder.cc

index 875ec5fcd36353fa3f932d753429ea771d284e77..abb4d13a1ec404daccdb0f7ef21f6bf94a70234e 100644 (file)
@@ -56,7 +56,7 @@ Decoder::Decoder (boost::shared_ptr<Film> f, boost::shared_ptr<const Options> o,
        , _job (j)
        , _minimal (minimal)
        , _ignore_length (ignore_length)
-       , _video_frame (0)
+       , _video_frame_index (0)
        , _delay_line (0)
        , _delay_in_bytes (0)
        , _audio_frames_processed (0)
@@ -97,19 +97,19 @@ Decoder::process_end ()
           in to get it to the right length.
        */
 
-       int64_t const video_length_in_audio_frames = ((int64_t) video_frame() * audio_sample_rate() / frames_per_second());
+       int64_t const video_length_in_audio_frames = ((int64_t) video_frame_index() * audio_sample_rate() / frames_per_second());
        int64_t const audio_short_by_frames = video_length_in_audio_frames - _audio_frames_processed;
 
        _film->log()->log (
                String::compose ("DCP length is %1 (%2 audio frames); %3 frames of audio processed.",
-                                video_frame(),
+                                video_frame_index(),
                                 video_length_in_audio_frames,
                                 _audio_frames_processed)
                );
        
        if (audio_short_by_frames >= 0 && _opt->decode_audio) {
 
-               _film->log()->log (String::compose ("DCP length is %1; %2 frames of audio processed.", video_frame(), _audio_frames_processed));
+               _film->log()->log (String::compose ("DCP length is %1; %2 frames of audio processed.", video_frame_index(), _audio_frames_processed));
                _film->log()->log (String::compose ("Adding %1 frames of silence to the end.", audio_short_by_frames));
 
                /* XXX: this is slightly questionable; does memset () give silence with all
@@ -142,7 +142,7 @@ Decoder::go ()
 
        while (pass () == false) {
                if (_job && _film->dcp_length()) {
-                       _job->set_progress (float (_video_frame) / _film->dcp_length().get());
+                       _job->set_progress (float (_video_frame_index) / _film->dcp_length().get());
                }
        }
 
@@ -156,7 +156,7 @@ Decoder::go ()
 bool
 Decoder::pass ()
 {
-       if (!_ignore_length && _video_frame >= _film->dcp_length()) {
+       if (!_ignore_length && _video_frame_index >= _film->dcp_length()) {
                return true;
        }
 
@@ -266,7 +266,7 @@ void
 Decoder::process_video (AVFrame* frame)
 {
        if (_minimal) {
-               ++_video_frame;
+               ++_video_frame_index;
                return;
        }
 
@@ -277,8 +277,8 @@ Decoder::process_video (AVFrame* frame)
                gap = _film->length().get() / _opt->decode_video_frequency;
        }
 
-       if (_opt->decode_video_frequency != 0 && gap != 0 && (_video_frame % gap) != 0) {
-               ++_video_frame;
+       if (_opt->decode_video_frequency != 0 && gap != 0 && (_video_frame_index % gap) != 0) {
+               ++_video_frame_index;
                return;
        }
 
@@ -300,18 +300,18 @@ Decoder::process_video (AVFrame* frame)
        list<shared_ptr<Image> > images = graph->process (frame);
 
        for (list<shared_ptr<Image> >::iterator i = images.begin(); i != images.end(); ++i) {
-               if (_opt->black_after > 0 && _video_frame > _opt->black_after) {
+               if (_opt->black_after > 0 && _video_frame_index > _opt->black_after) {
                        (*i)->make_black ();
                }
                
                shared_ptr<Subtitle> sub;
-               if (_timed_subtitle && _timed_subtitle->displayed_at (double (video_frame()) / _film->frames_per_second())) {
+               if (_timed_subtitle && _timed_subtitle->displayed_at (double (video_frame_index()) / _film->frames_per_second())) {
                        sub = _timed_subtitle->subtitle ();
                }
                
-               TIMING ("Decoder emits %1", _video_frame);
-               Video ((*i), _video_frame, sub);
-               ++_video_frame;
+               TIMING ("Decoder emits %1", _video_frame_index);
+               Video ((*i), _video_frame_index, sub);
+               ++_video_frame_index;
        }
 }
 
index 31cf9d97d42e94c400f4e5c1df07da5dbbf91c7b..2af9157b4da6175ae78c5f666ee9763f05afcf0e 100644 (file)
@@ -81,8 +81,8 @@ public:
        void go ();
 
        /** @return the index of the last video frame to be processed */
-       int video_frame () const {
-               return _video_frame;
+       int video_frame_index () const {
+               return _video_frame_index;
        }
 
        virtual std::vector<AudioStream> audio_streams () const {
@@ -134,7 +134,7 @@ private:
        void emit_audio (uint8_t* data, int size);
        
        /** last video frame to be processed */
-       int _video_frame;
+       int _video_frame_index;
 
        std::list<boost::shared_ptr<FilterGraph> > _filter_graphs;
 
index 67ea16648855a8154c8a707a5f3d6f30c346767e..943e9fbf7dfa2a33c7a27b6800a789676139d69c 100644 (file)
@@ -69,9 +69,9 @@ ExamineContentJob::run ()
        _decoder = decoder_factory (_film, o, this, true, true);
        _decoder->go ();
 
-       _film->set_length (_decoder->video_frame ());
+       _film->set_length (_decoder->video_frame_index());
 
-       _film->log()->log (String::compose ("Video length is %1 frames", _decoder->video_frame()));
+       _film->log()->log (String::compose ("Video length is %1 frames", _decoder->video_frame_index()));
 
        ascend ();
 
index 5b96d899ae1a42b96361d141841839e5e3ea8d92..a9db6f4893bae07c19daa54b8267f1df3836420c 100644 (file)
@@ -285,7 +285,7 @@ FFmpegDecoder::do_pass ()
                if (avcodec_decode_video2 (_video_codec_context, _video_frame[_this_video_frame], &frame_finished, &_packet) >= 0 && frame_finished) {
 
                        /* Where we are in the output, in seconds */
-                       double const out_pts_seconds = video_frame() / frames_per_second();
+                       double const out_pts_seconds = video_frame_index() / frames_per_second();
 
                        /* Difference between where we are and where we should be */
                        double const delta = pts_seconds - out_pts_seconds;