diff options
author | Chris Robinson <[email protected]> | 2014-11-02 00:27:26 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-11-02 00:27:26 -0700 |
commit | 9d82ab9d1f399e0460870b72c0967b2311adfa4e (patch) | |
tree | 60217b5a51de09002c7f09ee132bad796ba9a1b2 /Alc/mixer.c | |
parent | c82f39decd4ec1f772f556cf38aa8afb83be41b3 (diff) |
Use the copy resampler only when there's no sub-sample offset
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r-- | Alc/mixer.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c index 762fc7fe..8db51c12 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -69,11 +69,9 @@ static inline MixerFunc SelectMixer(void) return Mix_C; } -static inline ResamplerFunc SelectResampler(enum Resampler Resampler, ALuint increment) +static inline ResamplerFunc SelectResampler(enum Resampler resampler) { - if(increment == FRACTIONONE) - return Resample_copy32_C; - switch(Resampler) + switch(resampler) { case PointResampler: return Resample_point32_C; @@ -202,10 +200,10 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam DataPosInt = Source->position; DataPosFrac = Source->position_fraction; Looping = Source->Looping; - increment = voice->Step; - Resampler = (increment==FRACTIONONE) ? PointResampler : Source->Resampler; + Resampler = Source->Resampler; NumChannels = Source->NumChannels; SampleSize = Source->SampleSize; + increment = voice->Step; while(BufferListItem) { @@ -221,7 +219,8 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam Mix = SelectMixer(); HrtfMix = SelectHrtfMixer(); - Resample = SelectResampler(Resampler, increment); + Resample = ((increment == FRACTIONONE && DataPosFrac == 0) ? + Resample_copy32_C : SelectResampler(Resampler)); OutPos = 0; do { |