Audio mixer: remove check for ratio > 1.0.

The code actually handles this case correctly; the algorithm is linear
interpolation between the two closest samples, and the way it is written
should work correctly with any ratio.
This commit is contained in:
magumagu 2014-05-12 23:34:53 -07:00
parent d43ecd0bd1
commit 40e2ce4f27
1 changed files with 1 additions and 3 deletions

View File

@ -54,9 +54,7 @@ unsigned int CMixer::MixerFifo::Mix(short* samples, unsigned int numSamples, boo
static u32 frac = 0;
const u32 ratio = (u32)( 65536.0f * aid_sample_rate / (float)m_mixer->m_sampleRate );
if (ratio > 0x10000)
ERROR_LOG(AUDIO, "ratio out of range");
// TODO: consider a higher-quality resampling algorithm.
for (; currentSample < numSamples*2 && ((indexW-indexR) & INDEX_MASK) > 2; currentSample+=2) {
u32 indexR2 = indexR + 2; //next sample