mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 06:39:14 +01:00
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:
parent
d43ecd0bd1
commit
40e2ce4f27
@ -54,9 +54,7 @@ unsigned int CMixer::MixerFifo::Mix(short* samples, unsigned int numSamples, boo
|
|||||||
static u32 frac = 0;
|
static u32 frac = 0;
|
||||||
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 );
|
||||||
|
|
||||||
if (ratio > 0x10000)
|
// TODO: consider a higher-quality resampling algorithm.
|
||||||
ERROR_LOG(AUDIO, "ratio out of range");
|
|
||||||
|
|
||||||
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
|
u32 indexR2 = indexR + 2; //next sample
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user