diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-08-17 15:44:58 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-08-17 15:44:58 +0200 |
| commit | 6abf2fdd53b14608561fcc1900507daea5b79fb7 (patch) | |
| tree | f35ecc5becacc3733c856d20051f58d681a2d454 /src/lib/butler.h | |
| parent | fe44dba0f2ad2ad9fcdfcee11213794a7a6a01e0 (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.h | 23 |
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; |
