X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ftranscode_job.cc;h=4a2d768f479c7c67fa600ef46c56954d5a60bae2;hb=e60bb3e51bd1508b149e6b8f6608f09b5196ae26;hp=23a46d06dddcb7875a9247911d387028a0da802e;hpb=cb1dfa9ec09af2abf6d10e4bf2764476db83841b;p=dcpomatic.git diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc index 23a46d06d..4a2d768f4 100644 --- a/src/lib/transcode_job.cc +++ b/src/lib/transcode_job.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington + Copyright (C) 2012-2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,10 +42,10 @@ using boost::shared_ptr; /** @param s Film to use. */ -TranscodeJob::TranscodeJob (shared_ptr f) - : Job (f) +TranscodeJob::TranscodeJob (shared_ptr film) + : Job (film) { - + } string @@ -54,6 +54,12 @@ TranscodeJob::name () const return String::compose (_("Transcode %1"), _film->name()); } +string +TranscodeJob::json_name () const +{ + return N_("transcode"); +} + void TranscodeJob::run () { @@ -70,9 +76,6 @@ TranscodeJob::run () _transcoder.reset (); } catch (...) { - set_progress (1); - set_state (FINISHED_ERROR); - LOG_ERROR_NC (N_("Transcode job failed or cancelled")); _transcoder.reset (); throw; } @@ -95,9 +98,10 @@ TranscodeJob::status () const s << Job::status (); if (!finished () && !_transcoder->finishing ()) { - s << "; " << fixed << setprecision (1) << fps << " " << _("frames per second"); + /// TRANSLATORS: fps here is an abbreviation for frames per second + s << "; " << fixed << setprecision (1) << fps << " " << _("fps"); } - + return s.str (); } @@ -107,11 +111,11 @@ TranscodeJob::remaining_time () const { /* _transcoder might be destroyed by the job-runner thread */ shared_ptr t = _transcoder; - + if (!t) { return 0; } - + float fps = t->current_encoding_rate (); if (fps == 0) {