Make digest calculations interruptible.
[dcpomatic.git] / src / lib / reel_writer.cc
index cd6a1a4b9d54c51d8d360dc3eae3c0823c15bc4e..a3d499abe51a6ce3a0a9b514601ad7c5aec6b5be 100644 (file)
@@ -745,6 +745,7 @@ ReelWriter::create_reel (
 
 void
 ReelWriter::calculate_digests (boost::function<void (float)> set_progress)
+try
 {
        if (_picture_asset) {
                _picture_asset->hash (set_progress);
@@ -757,6 +758,10 @@ ReelWriter::calculate_digests (boost::function<void (float)> set_progress)
        if (_atmos_asset) {
                _atmos_asset->hash (set_progress);
        }
+} catch (boost::thread_interrupted) {
+       /* set_progress contains an interruption_point, so any of these methods
+        * may throw thread_interrupted, at which point we just give up.
+        */
 }
 
 Frame