diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-05-09 16:52:26 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-05-09 16:52:26 +0100 |
| commit | 78c27b4fa4d23d4a0a64f0398350ec5697d50551 (patch) | |
| tree | 56c5b733d812745eeadf767a4fd68d8e470c5a9c /src/lib/ffmpeg_transcoder.cc | |
| parent | 6a11232620e0006f6a2b1e8d2b56e56d84229d5c (diff) | |
Slight tidy up of progress stuff in TranscodeJob.
Diffstat (limited to 'src/lib/ffmpeg_transcoder.cc')
| -rw-r--r-- | src/lib/ffmpeg_transcoder.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/lib/ffmpeg_transcoder.cc b/src/lib/ffmpeg_transcoder.cc index 3ebd0e817..19c55ff7a 100644 --- a/src/lib/ffmpeg_transcoder.cc +++ b/src/lib/ffmpeg_transcoder.cc @@ -164,11 +164,7 @@ FFmpegTranscoder::video (shared_ptr<PlayerVideo> video, DCPTime time) frame->width = image->size().width; frame->height = image->size().height; frame->format = _pixel_format; - { - boost::mutex::scoped_lock lm (_mutex); - _last_frame = time.frames_round(_film->video_frame_rate()); - frame->pts = _last_frame / (_film->video_frame_rate() * av_q2d (_video_stream->time_base)); - } + frame->pts = time.seconds() / av_q2d (_video_stream->time_base); AVPacket packet; av_init_packet (&packet); @@ -191,6 +187,11 @@ FFmpegTranscoder::video (shared_ptr<PlayerVideo> video, DCPTime time) _history.event (); + { + boost::mutex::scoped_lock lm (_mutex); + _last_time = time; + } + shared_ptr<Job> job = _job.lock (); if (job) { job->set_progress (float(time.get()) / _film->length().get()); @@ -210,14 +211,14 @@ FFmpegTranscoder::subtitle (PlayerSubtitles subs, DCPTimePeriod period) } float -FFmpegTranscoder::current_encoding_rate () const +FFmpegTranscoder::current_rate () const { return _history.rate (); } -int -FFmpegTranscoder::video_frames_enqueued () const +Frame +FFmpegTranscoder::frames_done () const { boost::mutex::scoped_lock lm (_mutex); - return _last_frame; + return _last_time.frames_round (_film->video_frame_rate ()); } |
