X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ftranscode_job.cc;h=fd69b08e7c58b5a353570433d5f53c937585ed48;hb=2d5b8cdde08044d323aa7193dfac6c9f8bca7131;hp=0c3b8c37b978b9d5c94c058cfafbde11db552ec0;hpb=92cafb6fc686a041354da2eabde6bcb2f6846e1d;p=dcpomatic.git diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc index 0c3b8c37b..fd69b08e7 100644 --- a/src/lib/transcode_job.cc +++ b/src/lib/transcode_job.cc @@ -25,10 +25,8 @@ #include #include "transcode_job.h" #include "film.h" -#include "format.h" #include "transcoder.h" #include "log.h" -#include "encoder.h" #include "i18n.h" @@ -40,7 +38,7 @@ using boost::shared_ptr; /** @param s Film to use. */ -TranscodeJob::TranscodeJob (shared_ptr f) +TranscodeJob::TranscodeJob (shared_ptr f) : Job (f) { @@ -58,7 +56,6 @@ TranscodeJob::run () try { _film->log()->log (N_("Transcode job starting")); - _film->log()->log (String::compose (N_("Audio delay is %1ms"), _film->audio_delay())); _transcoder.reset (new Transcoder (_film, shared_from_this ())); _transcoder->go (); @@ -93,8 +90,8 @@ TranscodeJob::status () const s << Job::status (); - if (!finished ()) { - s << N_("; ") << fixed << setprecision (1) << fps << N_(" ") << _("frames per second"); + if (!finished () && !_transcoder->finishing ()) { + s << "; " << fixed << setprecision (1) << fps << " " << _("frames per second"); } return s.str (); @@ -113,18 +110,7 @@ TranscodeJob::remaining_time () const return 0; } - if (!_film->video_length()) { - return 0; - } - /* Compute approximate proposed length here, as it's only here that we need it */ - int length = _film->video_length(); - FrameRateConversion const frc (_film->video_frame_rate(), _film->dcp_frame_rate()); - if (frc.skip) { - length /= 2; - } - /* If we are repeating it shouldn't affect transcode time, so don't take it into account */ - - int const left = length - _transcoder->video_frames_out(); + OutputVideoFrame const left = _film->time_to_video_frames (_film->length ()) - _transcoder->video_frames_out(); return left / fps; }