output/Internal: remember the most recent error

This commit is contained in:
Max Kellermann
2016-12-27 07:36:12 +01:00
parent a9f2d25957
commit ef9acc54ec
2 changed files with 16 additions and 0 deletions

View File

@@ -29,6 +29,8 @@
#include "thread/Thread.hxx"
#include "system/PeriodClock.hxx"
#include <exception>
class PreparedFilter;
class MusicPipe;
class EventLoop;
@@ -255,6 +257,14 @@ struct AudioOutput {
*/
AudioOutputSource source;
/**
* The error that occurred in the output thread. It is
* cleared whenever the output is opened successfully.
*
* Protected by #mutex.
*/
std::exception_ptr last_error;
/**
* Throws #std::runtime_error on error.
*/