summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorsktsqrl <sktsqrl@gmail.com>2012-07-11 01:03:25 -0700
committersktsqrl <sktsqrl@gmail.com>2012-07-11 01:03:25 -0700
commit1d44de53b59efa61660f5853cd3d21e21636f4a4 (patch)
treeef45d7114f99c5423587048b177ab470bd2fb4d4 /Source/Core
parentc57640dfbd53b80b71d62b53c1f87a7f5fade12b (diff)
reset samples_avail when stopping gc mic sampling. fixes Mario Party 7
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/HW/EXI_DeviceMic.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/Core/Core/Src/HW/EXI_DeviceMic.cpp b/Source/Core/Core/Src/HW/EXI_DeviceMic.cpp
index cba3940cdf..f1266d4c45 100644
--- a/Source/Core/Core/Src/HW/EXI_DeviceMic.cpp
+++ b/Source/Core/Core/Src/HW/EXI_DeviceMic.cpp
@@ -38,12 +38,12 @@ void CEXIMic::StreamLog(const char *msg)
void CEXIMic::StreamInit()
{
// Setup the wonderful c-interfaced lib...
- pa_stream = NULL;
+ pa_stream = nullptr;
if ((pa_error = Pa_Initialize()) != paNoError)
StreamLog("Pa_Initialize");
- stream_buffer = NULL;
+ stream_buffer = nullptr;
samples_avail = stream_wpos = stream_rpos = 0;
}
@@ -75,7 +75,7 @@ static int Pa_Callback(const void *inputBuffer, void *outputBuffer,
s16 *buff_in = (s16 *)inputBuffer;
s16 *buff_out = &mic->stream_buffer[mic->stream_wpos];
- if (buff_in == NULL)
+ if (buff_in == nullptr)
{
for (int i = 0; i < mic->buff_size_samples; i++)
{
@@ -118,11 +118,13 @@ void CEXIMic::StreamStart()
void CEXIMic::StreamStop()
{
- if (pa_stream != NULL && Pa_IsStreamActive(pa_stream) >= paNoError)
+ if (pa_stream != nullptr && Pa_IsStreamActive(pa_stream) >= paNoError)
Pa_AbortStream(pa_stream);
+ samples_avail = stream_wpos = stream_rpos = 0;
+
delete [] stream_buffer;
- stream_buffer = NULL;
+ stream_buffer = nullptr;
}
void CEXIMic::StreamReadOne()