diff --git a/Source/Core/Core/Src/HW/EXI_DeviceMic.cpp b/Source/Core/Core/Src/HW/EXI_DeviceMic.cpp index 9faff0e7b6..264d6a0539 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceMic.cpp +++ b/Source/Core/Core/Src/HW/EXI_DeviceMic.cpp @@ -29,8 +29,6 @@ #include "GCPad.h" -static bool pa_init = false; - void CEXIMic::StreamLog(const char *msg) { DEBUG_LOG(EXPANSIONINTERFACE, "%s: %s", @@ -40,46 +38,24 @@ void CEXIMic::StreamLog(const char *msg) void CEXIMic::StreamInit() { // Setup the wonderful c-interfaced lib... - pa_error = paNoError; - if (!pa_init) - { - pa_error = Pa_Initialize(); - - if (pa_error != paNoError) - { - StreamLog("Pa_Initialize"); - } - else - pa_init = true; - } - - mic_count++; + if ((pa_error = Pa_Initialize()) != paNoError) + StreamLog("Pa_Initialize"); } void CEXIMic::StreamTerminate() { - if (--mic_count <= 0 && pa_init) - pa_error = Pa_Terminate(); - - if (pa_error != paNoError) - { + if ((pa_error = Pa_Terminate()) != paNoError) StreamLog("Pa_Terminate"); - } - else - pa_init = false; } void CEXIMic::StreamStart() { // Open stream with current parameters - if (pa_init) - { - pa_error = Pa_OpenDefaultStream(&pa_stream, 1, 0, paInt16, - sample_rate, buff_size_samples, NULL, NULL); - StreamLog("Pa_OpenDefaultStream"); - pa_error = Pa_StartStream(pa_stream); - StreamLog("Pa_StartStream"); - } + pa_error = Pa_OpenDefaultStream(&pa_stream, 1, 0, paInt16, + sample_rate, buff_size_samples, NULL, NULL); + StreamLog("Pa_OpenDefaultStream"); + pa_error = Pa_StartStream(pa_stream); + StreamLog("Pa_StartStream"); } void CEXIMic::StreamStop() @@ -122,7 +98,6 @@ void CEXIMic::StreamReadOne() // us a way to detect if buff_ovrflw should be set. u8 const CEXIMic::exi_id[] = { 0, 0x0a, 0, 0, 0 }; -int CEXIMic::mic_count = 0; CEXIMic::CEXIMic(int index) : slot(index) diff --git a/Source/Core/Core/Src/HW/EXI_DeviceMic.h b/Source/Core/Core/Src/HW/EXI_DeviceMic.h index 491a112375..bdae580135 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceMic.h +++ b/Source/Core/Core/Src/HW/EXI_DeviceMic.h @@ -30,7 +30,6 @@ public: bool IsPresent(); private: - static int mic_count; static u8 const exi_id[]; static int const sample_size = sizeof(s16); static int const rate_base = 11025;