summaryrefslogtreecommitdiff
path: root/src/lib/butler.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-08-17 15:44:58 +0200
committerCarl Hetherington <cth@carlh.net>2020-08-17 15:44:58 +0200
commit6abf2fdd53b14608561fcc1900507daea5b79fb7 (patch)
treef35ecc5becacc3733c856d20051f58d681a2d454 /src/lib/butler.h
parentfe44dba0f2ad2ad9fcdfcee11213794a7a6a01e0 (diff)
Report better errors when the butler dies.
Adapted from d23f55d8cd73adda823d0a2fcabc129b8845a81 in master.
Diffstat (limited to 'src/lib/butler.h')
-rw-r--r--src/lib/butler.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/lib/butler.h b/src/lib/butler.h
index 6263d6143..e13843c90 100644
--- a/src/lib/butler.h
+++ b/src/lib/butler.h
@@ -49,11 +49,23 @@ public:
void seek (dcpomatic::DCPTime position, bool accurate);
- enum Error {
- NONE,
- AGAIN,
- DIED,
- FINISHED
+ class Error {
+ public:
+ enum Code{
+ NONE,
+ AGAIN,
+ DIED,
+ FINISHED
+ };
+
+ Error()
+ : code (NONE)
+ {}
+
+ Code code;
+ std::string message;
+
+ std::string summary () const;
};
std::pair<boost::shared_ptr<PlayerVideo>, dcpomatic::DCPTime> get_video (bool blocking, Error* e = 0);
@@ -94,6 +106,7 @@ private:
int _suspended;
bool _finished;
bool _died;
+ std::string _died_message;
bool _stop_thread;
AudioMapping _audio_mapping;