}
}
- struct timeval start;
- gettimeofday (&start, 0);
LOG_GENERAL_NC (N_("Transcode job starting"));
DCPOMATIC_ASSERT (_encoder);
_encoder->go ();
- struct timeval finish;
- gettimeofday (&finish, 0);
-
- float fps = 0;
- if (finish.tv_sec != start.tv_sec) {
- fps = _encoder->frames_done() / (finish.tv_sec - start.tv_sec);
- }
+ set_progress (1);
+ set_state (FINISHED_OK);
- LOG_GENERAL (N_("Transcode job completed successfully: %1 fps"), fps);
+ LOG_GENERAL(N_("Transcode job completed successfully: %1 fps"), dcp::locale_convert<string>(frames_per_second(), 2, true));
if (dynamic_pointer_cast<DCPEncoder>(_encoder)) {
try {
}
}
- /* XXX: this shouldn't be here */
- if (Config::instance()->upload_after_make_dcp() && dynamic_pointer_cast<DCPEncoder>(_encoder)) {
- JobManager::instance()->add(make_shared<UploadJob>(_film));
- }
+ post_transcode ();
_encoder.reset ();
- set_progress (1);
- set_state (FINISHED_OK);
-
} catch (...) {
_encoder.reset ();
throw;
/* Compute approximate proposed length here, as it's only here that we need it */
return (_film->length().frames_round(_film->video_frame_rate()) - e->frames_done()) / *fps;
}
+
+
+float
+TranscodeJob::frames_per_second() const
+{
+ if (_finish_time != _start_time) {
+ return _encoder->frames_done() / (_finish_time - _start_time);
+ } else {
+ return 0;
+ }
+}
+