summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-10-30 15:05:32 +0000
committerCarl Hetherington <cth@carlh.net>2012-10-30 15:05:32 +0000
commite3636952b0d443f61c2966450cc68bc25480dfe2 (patch)
tree9f215a4400bccbb39257827a8e91b961dd0ed4a5 /src/lib
parentc191d7f6bf9dfae30a451f5cc3e434812fd43e6c (diff)
Tweak naming.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/decoder.cc8
-rw-r--r--src/lib/decoder.h2
-rw-r--r--src/lib/examine_content_job.cc10
-rw-r--r--src/lib/examine_content_job.h2
-rw-r--r--src/lib/ffmpeg_decoder.cc2
5 files changed, 8 insertions, 16 deletions
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<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 ();
}
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> _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;