X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ftranscode_job.cc;h=23a46d06dddcb7875a9247911d387028a0da802e;hb=c6c082c4a8016f85ba4207f4b8ccee1d5770e4a4;hp=ef15f9f5e9865968ecee6f6b87e0437e672d1e66;hpb=2935d9d158cf35496a35107f9c4ab7d2929cf6c3;p=dcpomatic.git diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc index ef15f9f5e..23a46d06d 100644 --- a/src/lib/transcode_job.cc +++ b/src/lib/transcode_job.cc @@ -27,6 +27,7 @@ #include "film.h" #include "transcoder.h" #include "log.h" +#include "safe_stringstream.h" #include "i18n.h" @@ -34,9 +35,9 @@ #define LOG_ERROR_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_ERROR); using std::string; -using std::stringstream; using std::fixed; using std::setprecision; +using std::cout; using boost::shared_ptr; /** @param s Film to use. @@ -53,12 +54,6 @@ TranscodeJob::name () const return String::compose (_("Transcode %1"), _film->name()); } -string -TranscodeJob::json_name () const -{ - return N_("transcode"); -} - void TranscodeJob::run () { @@ -95,7 +90,7 @@ TranscodeJob::status () const return Job::status (); } - stringstream s; + SafeStringStream s; s << Job::status (); @@ -106,6 +101,7 @@ TranscodeJob::status () const return s.str (); } +/** @return Approximate remaining time in seconds */ int TranscodeJob::remaining_time () const { @@ -123,6 +119,5 @@ TranscodeJob::remaining_time () const } /* Compute approximate proposed length here, as it's only here that we need it */ - OutputVideoFrame const left = _film->time_to_video_frames (_film->length ()) - t->video_frames_out(); - return left / fps; + return (_film->length().frames (_film->video_frame_rate ()) - t->video_frames_out()) / fps; }