diff --git a/stepmania/src/arch/Sound/CAHelpers.cpp b/stepmania/src/arch/Sound/CAHelpers.cpp index b4258c9177..08cc94bcec 100644 --- a/stepmania/src/arch/Sound/CAHelpers.cpp +++ b/stepmania/src/arch/Sound/CAHelpers.cpp @@ -44,4 +44,3 @@ OSStatus AudioConverter::FormatConverterInputProc(UInt32& ioNumberDataPackets, buf.mData = mBuffer; return noErr; } - diff --git a/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp b/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp index 49fdebbcd0..f3535f4436 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp @@ -11,11 +11,7 @@ #include #include -namespace -{ - AudioConverter *gConverter; -} - +static AudioConverter *gConverter; static Desc FindClosestFormat(const vector& formats) { @@ -91,10 +87,11 @@ RageSound_CA::RageSound_CA() try { UInt32 frames = mOutputDevice->GetLatency(kAudioDeviceSectionOutput); - mLatency = frames / 44100.0; // maybe? I'm tired, I don't know. + mLatency = frames / 44100.0; } catch (const CAException& e) { + delete mOutputDevice; RageException::ThrowNonfatal("Couldn't get Latency."); } @@ -122,7 +119,8 @@ RageSound_CA::RageSound_CA() } catch(const CAException& e) { - delete gConverter; + delete gConverter; + delete mOutputDevice; RageException::Throw("Couldn't start the IOProc."); } } @@ -171,6 +169,7 @@ void RageSound_CA::SetupDecodingThread() /* Increase the scheduling precedence of the decoder thread. */ thread_precedence_policy po; po.importance = 5; - thread_policy_set( mach_thread_self(), THREAD_PRECEDENCE_POLICY, (int *)&po, THREAD_PRECEDENCE_POLICY_COUNT ); + thread_policy_set( mach_thread_self(), THREAD_PRECEDENCE_POLICY, + (int *)&po, THREAD_PRECEDENCE_POLICY_COUNT ); }