2015-09-01 Carl Hetherington <cth@carlh.net>
+ * Allow cancellation of transcodes during the
+ checking of existing frames (#679).
+
* Version 2.1.49 released.
2015-08-31 Carl Hetherington <cth@carlh.net>
return;
}
+ set_progress_common (p);
+}
+
+void
+Job::set_progress_common (optional<float> p)
+{
boost::mutex::scoped_lock lm (_progress_mutex);
_progress = p;
boost::this_thread::interruption_point ();
void
Job::set_progress_unknown ()
{
- boost::mutex::scoped_lock lm (_progress_mutex);
- _progress.reset ();
- lm.unlock ();
-
- emit (boost::bind (boost::ref (Progress)));
+ set_progress_common (optional<float> ());
}
/** @return Human-readable status of this job */
private:
void run_wrapper ();
+ void set_progress_common (boost::optional<float> p);
boost::thread* _thread;
throw InvalidSignerError ();
}
- _thread = new boost::thread (boost::bind (&Writer::thread, this));
-
job->sub (_("Encoding image data"));
+
+ /* Do this last; if something after this line were to throw an exception
+ (say if Job::sub was interrupted by cancel) this thread would never
+ get properly cleaned up but the Writer object would go away underneath
+ it.
+ */
+ _thread = new boost::thread (boost::bind (&Writer::thread, this));
}
Writer::~Writer ()