mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-01 23:59:43 +02:00
Make controller async, add client Mixer settings
Controller uses the asio io_context and thus uses one thread less. This also fixes a lot of thread sanitizer issues.
This commit is contained in:
parent
4ce69d4bfb
commit
9bb1c4a041
22 changed files with 838 additions and 711 deletions
|
@ -32,7 +32,8 @@ void callback(void* custom_data, AudioQueueRef queue, AudioQueueBufferRef buffer
|
|||
}
|
||||
|
||||
|
||||
CoreAudioPlayer::CoreAudioPlayer(const PcmDevice& pcmDevice, std::shared_ptr<Stream> stream) : Player(pcmDevice, stream), ms_(100), pubStream_(stream)
|
||||
CoreAudioPlayer::CoreAudioPlayer(boost::asio::io_context& io_context, const ClientSettings::Player& settings, std::shared_ptr<Stream> stream)
|
||||
: Player(io_context, settings, stream), ms_(100), pubStream_(stream)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -130,6 +131,12 @@ void CoreAudioPlayer::playerCallback(AudioQueueRef queue, AudioQueueBufferRef bu
|
|||
}
|
||||
|
||||
|
||||
bool CoreAudioPlayer::needsThread() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CoreAudioPlayer::worker()
|
||||
{
|
||||
while (active_)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue