From: Carl Hetherington Date: Tue, 30 Oct 2012 15:05:32 +0000 (+0000) Subject: Tweak naming. X-Git-Tag: v2.0.48~1598 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=e3636952b0d443f61c2966450cc68bc25480dfe2;p=dcpomatic.git Tweak naming. --- diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc index f911ccbf9..6568ad089 100644 --- a/src/lib/decoder.cc +++ b/src/lib/decoder.cc @@ -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 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 (); } diff --git a/src/lib/decoder.h b/src/lib/decoder.h index cbcfe7008..31cf9d97d 100644 --- a/src/lib/decoder.h +++ b/src/lib/decoder.h @@ -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; } diff --git a/src/lib/examine_content_job.cc b/src/lib/examine_content_job.cc index 1e263ffa5..67ea16648 100644 --- a/src/lib/examine_content_job.cc +++ b/src/lib/examine_content_job.cc @@ -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 (); -} diff --git a/src/lib/examine_content_job.h b/src/lib/examine_content_job.h index 098b9d132..d87bd0876 100644 --- a/src/lib/examine_content_job.h +++ b/src/lib/examine_content_job.h @@ -37,8 +37,6 @@ public: std::string name () const; void run (); - int last_video_frame () const; - private: boost::shared_ptr _decoder; }; diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 221f5d9d7..023b6d540 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -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;