Tweak naming.
authorCarl Hetherington <cth@carlh.net>
Tue, 30 Oct 2012 15:05:32 +0000 (15:05 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 30 Oct 2012 15:05:32 +0000 (15:05 +0000)
src/lib/decoder.cc
src/lib/decoder.h
src/lib/examine_content_job.cc
src/lib/examine_content_job.h
src/lib/ffmpeg_decoder.cc

index f911ccbf9bfb7529961492362248586fbd4ebde5..6568ad08915e108e194a966957c7d689ad10da71 100644 (file)
@@ -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) last_video_frame() * audio_sample_rate() / frames_per_second());
+       int64_t const video_length_in_audio_frames = ((int64_t) video_frame() * 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.",
-                                last_video_frame(),
+                                video_frame(),
                                 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.", last_video_frame(), _audio_frames_processed));
+               _film->log()->log (String::compose ("DCP length is %1; %2 frames of audio processed.", video_frame(), _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
@@ -298,7 +298,7 @@ Decoder::process_video (AVFrame* frame)
                }
                
                shared_ptr<Subtitle> sub;
-               if (_timed_subtitle && _timed_subtitle->displayed_at (double (last_video_frame()) / _film->frames_per_second())) {
+               if (_timed_subtitle && _timed_subtitle->displayed_at (double (video_frame()) / _film->frames_per_second())) {
                        sub = _timed_subtitle->subtitle ();
                }
                
index cbcfe7008e1a4045a6e63e46b5dc912a94fe9cc1..31cf9d97d42e94c400f4e5c1df07da5dbbf91c7b 100644 (file)
@@ -81,7 +81,7 @@ public:
        void go ();
 
        /** @return the index of the last video frame to be processed */
-       int last_video_frame () const {
+       int video_frame () const {
                return _video_frame;
        }
 
index 1e263ffa585f97b413bd4cbe84db6c77c65a7ad3..67ea16648855a8154c8a707a5f3d6f30c346767e 100644 (file)
@@ -69,9 +69,9 @@ ExamineContentJob::run ()
        _decoder = decoder_factory (_film, o, this, true, true);
        _decoder->go ();
 
-       _film->set_length (_decoder->last_video_frame ());
+       _film->set_length (_decoder->video_frame ());
 
-       _film->log()->log (String::compose ("Video length is %1 frames", _decoder->last_video_frame()));
+       _film->log()->log (String::compose ("Video length is %1 frames", _decoder->video_frame()));
 
        ascend ();
 
@@ -126,9 +126,3 @@ ExamineContentJob::run ()
        set_progress (1);
        set_state (FINISHED_OK);
 }
-
-int
-ExamineContentJob::last_video_frame () const
-{
-       return _decoder->last_video_frame ();
-}
index 098b9d13262e61bd4566d1a430ed119b19a84cbb..d87bd0876b23b160c346643dc29768689aa7d11c 100644 (file)
@@ -37,8 +37,6 @@ public:
        std::string name () const;
        void run ();
 
-       int last_video_frame () const;
-
 private:
        boost::shared_ptr<Decoder> _decoder;
 };
index 221f5d9d7588d082c1e50b2d3f37d8fad6093c01..023b6d540fe02134c328fc006fe5b0df535a1dd5 100644 (file)
@@ -267,7 +267,7 @@ FFmpegDecoder::do_pass ()
                if (avcodec_decode_video2 (_video_codec_context, _frame, &frame_finished, &_packet) >= 0 && frame_finished) {
 
                        /* Where we are in the output, in seconds */
-                       double const out_pts_seconds = last_video_frame() / frames_per_second();
+                       double const out_pts_seconds = video_frame() / frames_per_second();
 
                        /* Difference between where we are and where we should be */
                        double const delta = pts_seconds - out_pts_seconds;