From 4f324ad74280540efc7fdc66a30d43594118938d Mon Sep 17 00:00:00 2001 From: Benjamin Przybocki Date: Sun, 21 Dec 2014 12:06:08 -0600 Subject: Clean Up --- Source/Core/AudioCommon/Mixer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Core/AudioCommon/Mixer.cpp') 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); -- cgit v1.2.3