summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon/OpenALStream.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2015-05-09 23:48:22 -0400
committerLioncash <mathew1800@gmail.com>2015-05-10 01:02:25 -0400
commit4920dbed13b0bef0e17fe0ad9d73b9f702a5e523 (patch)
tree0b7f90ebfb32e75bda2d967873e8f1712800941c /Source/Core/AudioCommon/OpenALStream.cpp
parent78e59d08fe630d44d967b1a6f006e27d3bec4407 (diff)
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.
Diffstat (limited to 'Source/Core/AudioCommon/OpenALStream.cpp')
-rw-r--r--Source/Core/AudioCommon/OpenALStream.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/Core/AudioCommon/OpenALStream.cpp b/Source/Core/AudioCommon/OpenALStream.cpp
index 57c2e286d6..c8cb9d23eb 100644
--- a/Source/Core/AudioCommon/OpenALStream.cpp
+++ b/Source/Core/AudioCommon/OpenALStream.cpp
@@ -23,6 +23,7 @@ static soundtouch::SoundTouch soundTouch;
//
bool OpenALStream::Start()
{
+ m_run_thread.store(true);
bool bReturn = false;
ALDeviceList pDeviceList;
@@ -72,7 +73,7 @@ bool OpenALStream::Start()
void OpenALStream::Stop()
{
- threadData = 1;
+ m_run_thread.store(false);
// kick the thread if it's waiting
soundSyncEvent.Set();
@@ -183,7 +184,7 @@ void OpenALStream::SoundLoop()
soundTouch.setSetting(SETTING_SEEKWINDOW_MS, 28);
soundTouch.setSetting(SETTING_OVERLAP_MS, 12);
- while (!threadData)
+ while (m_run_thread.load())
{
// num_samples_to_render in this update - depends on SystemTimers::AUDIO_DMA_PERIOD.
const u32 stereo_16_bit_size = 4;