mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
AudioCommon: Migrate threadData to OpenALStream and AOSoundStream
This is only ever used in these two sound streams. Seems silly to have it as a class member. Converted it to an atomic as well.
This commit is contained in:
@ -32,7 +32,7 @@ void AOSound::SoundLoop()
|
||||
|
||||
buf_size = format.bits/8 * format.channels * format.rate;
|
||||
|
||||
while (!threadData)
|
||||
while (m_run_thread.load())
|
||||
{
|
||||
m_mixer->Mix(realtimeBuffer, numBytesToRender >> 2);
|
||||
|
||||
@ -47,6 +47,7 @@ void AOSound::SoundLoop()
|
||||
|
||||
bool AOSound::Start()
|
||||
{
|
||||
m_run_thread.store(true);
|
||||
memset(realtimeBuffer, 0, sizeof(realtimeBuffer));
|
||||
|
||||
thread = std::thread(&AOSound::SoundLoop, this);
|
||||
@ -60,7 +61,7 @@ void AOSound::Update()
|
||||
|
||||
void AOSound::Stop()
|
||||
{
|
||||
threadData = 1;
|
||||
m_run_thread.store(false);
|
||||
soundSyncEvent.Set();
|
||||
|
||||
{
|
||||
|
Reference in New Issue
Block a user