diff options
| author | magumagu <magumagu9@gmail.com> | 2015-02-10 11:39:14 -0800 |
|---|---|---|
| committer | magumagu <magumagu9@gmail.com> | 2015-02-10 11:39:14 -0800 |
| commit | 0f96a0104e60045e39d0c2a2ff34ec06bb8c3634 (patch) | |
| tree | 163ce59f9b1d45fcb5b563010408c4ca35c399f6 /Source/Core/AudioCommon/Mixer.cpp | |
| parent | 1acd80f23f09d14e921503b020e678f89544a6c3 (diff) | |
| parent | 4f324ad74280540efc7fdc66a30d43594118938d (diff) | |
Merge pull request #1752 from Buddybenj/clean-up
Clean Up
Diffstat (limited to 'Source/Core/AudioCommon/Mixer.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/Mixer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/AudioCommon/Mixer.cpp b/Source/Core/AudioCommon/Mixer.cpp index 60203b2f37..90f771d3fa 100644 --- a/Source/Core/AudioCommon/Mixer.cpp +++ b/Source/Core/AudioCommon/Mixer.cpp @@ -51,27 +51,27 @@ unsigned int CMixer::MixerFifo::Mix(short* samples, unsigned int numSamples, boo aid_sample_rate = aid_sample_rate * (framelimit - 1) * 5 / VideoInterface::TargetRefreshRate; } - const u32 ratio = (u32)( 65536.0f * aid_sample_rate / (float)m_mixer->m_sampleRate ); + const u32 ratio = (u32)(65536.0f * aid_sample_rate / (float)m_mixer->m_sampleRate); s32 lvolume = m_LVolume; s32 rvolume = m_RVolume; // TODO: consider a higher-quality resampling algorithm. - for (; currentSample < numSamples*2 && ((indexW-indexR) & INDEX_MASK) > 2; currentSample+=2) + for (; currentSample < numSamples * 2 && ((indexW-indexR) & INDEX_MASK) > 2; currentSample += 2) { u32 indexR2 = indexR + 2; //next sample s16 l1 = Common::swap16(m_buffer[indexR & INDEX_MASK]); //current s16 l2 = Common::swap16(m_buffer[indexR2 & INDEX_MASK]); //next - int sampleL = ((l1 << 16) + (l2 - l1) * (u16)m_frac) >> 16; + int sampleL = ((l1 << 16) + (l2 - l1) * (u16)m_frac) >> 16; sampleL = (sampleL * lvolume) >> 8; sampleL += samples[currentSample + 1]; MathUtil::Clamp(&sampleL, -32767, 32767); - samples[currentSample+1] = sampleL; + samples[currentSample + 1] = sampleL; s16 r1 = Common::swap16(m_buffer[(indexR + 1) & INDEX_MASK]); //current s16 r2 = Common::swap16(m_buffer[(indexR2 + 1) & INDEX_MASK]); //next - int sampleR = ((r1 << 16) + (r2 - r1) * (u16)m_frac) >> 16; + int sampleR = ((r1 << 16) + (r2 - r1) * (u16)m_frac) >> 16; sampleR = (sampleR * rvolume) >> 8; sampleR += samples[currentSample]; MathUtil::Clamp(&sampleR, -32767, 32767); |
