mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 19:58:53 +00: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:
parent
78e59d08fe
commit
4920dbed13
5 changed files with 12 additions and 9 deletions
|
@ -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();
|
||||
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue