aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-11-02 00:27:26 -0700
committerChris Robinson <[email protected]>2014-11-02 00:27:26 -0700
commit9d82ab9d1f399e0460870b72c0967b2311adfa4e (patch)
tree60217b5a51de09002c7f09ee132bad796ba9a1b2 /Alc/mixer.c
parentc82f39decd4ec1f772f556cf38aa8afb83be41b3 (diff)
Use the copy resampler only when there's no sub-sample offset
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r--Alc/mixer.c13
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 {