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:
badaix 2020-04-29 17:31:51 +02:00
parent 4ce69d4bfb
commit 9bb1c4a041
22 changed files with 838 additions and 711 deletions

View file

@ -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_)