summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-04-18 00:07:07 +0100
committerCarl Hetherington <cth@carlh.net>2017-04-19 23:04:32 +0100
commit361352316a011e648838588ad07bf69ba5edf344 (patch)
treea44b8f5b1eee1a4eefc59df88c94b88b5d7ae0e3 /src
parentb18c12353d22037d85086c150ff9b3d3a2546f4d (diff)
Handle butler thread exceptions properly.
Diffstat (limited to 'src')
-rw-r--r--src/lib/butler.cc2
-rw-r--r--src/lib/butler.h3
-rw-r--r--src/wx/film_viewer.cc4
3 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/butler.cc b/src/lib/butler.cc
index 7481b0301..81e09fbd3 100644
--- a/src/lib/butler.cc
+++ b/src/lib/butler.cc
@@ -98,6 +98,8 @@ try
}
} catch (boost::thread_interrupted) {
/* The butler thread is being terminated */
+} catch (...) {
+ store_current ();
}
pair<shared_ptr<PlayerVideo>, DCPTime>
diff --git a/src/lib/butler.h b/src/lib/butler.h
index f48352448..101677558 100644
--- a/src/lib/butler.h
+++ b/src/lib/butler.h
@@ -21,6 +21,7 @@
#include "video_ring_buffers.h"
#include "audio_ring_buffers.h"
#include "audio_mapping.h"
+#include "exception_store.h"
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/thread.hpp>
@@ -31,7 +32,7 @@ class Film;
class Player;
class PlayerVideo;
-class Butler : public boost::noncopyable
+class Butler : public ExceptionStore, public boost::noncopyable
{
public:
Butler (boost::weak_ptr<const Film> film, boost::shared_ptr<Player> player, AudioMapping map, int audio_channels);
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 588a27e01..fcaca2973 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -308,6 +308,10 @@ FilmViewer::timer ()
DCPTime const next = now + DCPTime::from_frames (1, _film->video_frame_rate ());
_timer.Start (max ((next.seconds() - time().seconds()) * 1000, 0.0), wxTIMER_ONE_SHOT);
}
+
+ if (_butler) {
+ _butler->rethrow ();
+ }
}
void