diff options
| author | Marko Pusljar <LM1234@gmail.com> | 2011-05-05 14:53:00 +0000 |
|---|---|---|
| committer | Marko Pusljar <LM1234@gmail.com> | 2011-05-05 14:53:00 +0000 |
| commit | ff63ef20c2bf33377c6c15aab5db08b2f8baad3b (patch) | |
| tree | aea0e97dc448091d120ee938352d2e331f96514a /Source/Core/AudioCommon | |
| parent | 3d7a2b92d44e4478d32aa528af00caaeb141d787 (diff) | |
Trying to fix mixer problem when AIsrc is @48kHz, should fix games like All Star Baseball 2004/
XGRA Extreme-G Racing Association/Conduit 2... Enabled 48kHz output for LLE (before it was just 32kHz). I hope it works, if there are serious problems, it will be reverted.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7511 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/AudioCommon')
| -rw-r--r-- | Source/Core/AudioCommon/Src/Mixer.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/Core/AudioCommon/Src/Mixer.cpp b/Source/Core/AudioCommon/Src/Mixer.cpp index b0f1f0f653..6ee0ddbf7a 100644 --- a/Source/Core/AudioCommon/Src/Mixer.cpp +++ b/Source/Core/AudioCommon/Src/Mixer.cpp @@ -58,8 +58,7 @@ unsigned int CMixer::Mix(short* samples, unsigned int numSamples) if (m_AIplaying) { numLeft = (numLeft > numSamples) ? numSamples : numLeft; - // Do re-sampling if needed - if (m_sampleRate == 32000) + if (AudioInterface::GetAIDSampleRate() == m_sampleRate) // (1:1) { #if _M_SSE >= 0x301 if (cpu_info.bSSSE3 && !((numLeft * 2) % 8)) @@ -91,7 +90,7 @@ unsigned int CMixer::Mix(short* samples, unsigned int numSamples) //remember fractional offset static u32 frac = 0; - const u32 ratio = (u32)( 65536.0f * 32000.0f / (float)m_sampleRate ); + const u32 ratio = (u32)( 65536.0f * (float)AudioInterface::GetAIDSampleRate() / (float)m_sampleRate ); for (u32 i = 0; i < numLeft * 2; i+=2) { u32 m_indexR2 = m_indexR + 2; //next sample @@ -199,10 +198,12 @@ void CMixer::PushSamples(const short *samples, unsigned int num_samples) m_indexW += num_samples * 2; - if (m_sampleRate == 32000) + if (AudioInterface::GetAIDSampleRate() == m_sampleRate) Common::AtomicAdd(m_numSamples, num_samples); - else // Assume 48000 otherwise + else if ((AudioInterface::GetAIDSampleRate() == 32000) && (m_sampleRate == 48000)) Common::AtomicAdd(m_numSamples, num_samples * 3 / 2); + else + Common::AtomicAdd(m_numSamples, num_samples * 2 / 3); return; } |
