mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-19 12:06:15 +02:00
Switch to exception_ptr for async exceptions
This commit is contained in:
parent
5e508cae2e
commit
d49b5c251c
5 changed files with 24 additions and 36 deletions
|
@ -42,6 +42,7 @@
|
|||
#include "metadata.hpp"
|
||||
#include "stream.hpp"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
/// Forwards PCM data to the audio player
|
||||
/**
|
||||
|
@ -64,11 +65,11 @@ public:
|
|||
|
||||
/// Implementation of MessageReceiver.
|
||||
/// Used for async exception reporting
|
||||
void onException(ClientConnection* connection, shared_exception_ptr exception) override;
|
||||
void onException(ClientConnection* connection, std::exception_ptr exception) override;
|
||||
|
||||
private:
|
||||
void worker();
|
||||
bool sendTimeSyncMessage(long after = 1000);
|
||||
bool sendTimeSyncMessage(const std::chrono::milliseconds& after = 1000ms);
|
||||
ClientSettings settings_;
|
||||
std::string meta_callback_;
|
||||
std::atomic<bool> active_;
|
||||
|
@ -83,7 +84,7 @@ private:
|
|||
std::unique_ptr<msg::CodecHeader> headerChunk_;
|
||||
std::mutex receiveMutex_;
|
||||
|
||||
shared_exception_ptr async_exception_;
|
||||
std::exception_ptr async_exception_;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue