diff options
| author | Lioncash <mathew1800@gmail.com> | 2014-08-30 18:20:13 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2014-08-30 18:20:13 -0400 |
| commit | 2c7bcd0d048c2e298a5d1e94cb493c6d879f6dd9 (patch) | |
| tree | 0159e4c50212488aca33dcff7dbe09ed4e251eed /Source/Core/AudioCommon/OpenSLESStream.cpp | |
| parent | 77aef014a0352d819e8ea63bafb6262b9af485cb (diff) | |
| parent | eb535be8741fd8672b5db972ca43360ca14a9a78 (diff) | |
Merge pull request #911 from lioncash/braces
Clean up brace placements within the project.
Diffstat (limited to 'Source/Core/AudioCommon/OpenSLESStream.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/OpenSLESStream.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Source/Core/AudioCommon/OpenSLESStream.cpp b/Source/Core/AudioCommon/OpenSLESStream.cpp index a3fefebb4c..996b7ae21a 100644 --- a/Source/Core/AudioCommon/OpenSLESStream.cpp +++ b/Source/Core/AudioCommon/OpenSLESStream.cpp @@ -30,7 +30,8 @@ static CMixer *g_mixer; static short buffer[2][BUFFER_SIZE]; static int curBuffer = 0; -static void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void *context) { +static void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void *context) +{ assert(bq == bqPlayerBufferQueue); assert(nullptr == context); @@ -49,6 +50,7 @@ static void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void *context) { // Render to the fresh buffer g_mixer->Mix(reinterpret_cast<short *>(buffer[curBuffer]), BUFFER_SIZE_IN_SAMPLES); } + bool OpenSLESStream::Start() { SLresult result; @@ -103,9 +105,11 @@ bool OpenSLESStream::Start() curBuffer = 0; result = (*bqPlayerBufferQueue)->Enqueue(bqPlayerBufferQueue, buffer[curBuffer], sizeof(buffer[curBuffer])); - if (SL_RESULT_SUCCESS != result) { + if (SL_RESULT_SUCCESS != result) + { return false; } + curBuffer ^= 1; g_mixer = m_mixer; return true; @@ -113,7 +117,8 @@ bool OpenSLESStream::Start() void OpenSLESStream::Stop() { - if (bqPlayerObject != nullptr) { + if (bqPlayerObject != nullptr) + { (*bqPlayerObject)->Destroy(bqPlayerObject); bqPlayerObject = nullptr; bqPlayerPlay = nullptr; @@ -121,11 +126,15 @@ void OpenSLESStream::Stop() bqPlayerMuteSolo = nullptr; bqPlayerVolume = nullptr; } - if (outputMixObject != nullptr) { + + if (outputMixObject != nullptr) + { (*outputMixObject)->Destroy(outputMixObject); outputMixObject = nullptr; } - if (engineObject != nullptr) { + + if (engineObject != nullptr) + { (*engineObject)->Destroy(engineObject); engineObject = nullptr; engineEngine = nullptr; |
