+ auto content = _film->content();
+ std::vector<shared_ptr<Content>> changed;
+ std::copy_if (content.begin(), content.end(), std::back_inserter(changed), [](shared_ptr<Content> c) { return c->changed(); });
+
+ if (!changed.empty()) {
+ switch (_changed) {
+ case ChangedBehaviour::EXAMINE_THEN_STOP:
+ for (auto i: changed) {
+ JobManager::instance()->add(make_shared<ExamineContentJob>(_film, i));
+ }
+ set_progress (1);
+ set_message (_("Some files have been changed since they were added to the project.\n\nThese files will now be re-examined, so you may need to check their settings before trying again."));
+ set_error (_("Files have changed since they were added to the project."), _("Check their new settings, then try again."));
+ set_state (FINISHED_ERROR);
+ return;
+ case ChangedBehaviour::STOP:
+ set_progress (1);
+ set_error (_("Files have changed since they were added to the project."), _("Open the project in DCP-o-matic, check the settings, then save it before trying again."));
+ set_state (FINISHED_ERROR);
+ return;
+ default:
+ LOG_GENERAL_NC (_("Some files have been changed since they were added to the project."));
+ break;
+ }
+ }
+
+ 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);
+ }
+
+ LOG_GENERAL (N_("Transcode job completed successfully: %1 fps"), fps);
+
+ if (dynamic_pointer_cast<DCPEncoder>(_encoder)) {
+ try {
+ Analytics::instance()->successful_dcp_encode();
+ } catch (FileError& e) {
+ LOG_WARNING (N_("Failed to write analytics (%1)"), e.what());
+ }
+ }
+
+ /* 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));
+ }
+
+ _encoder.reset ();