aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-04-21 00:06:40 -0700
committerChris Robinson <[email protected]>2017-04-21 00:06:40 -0700
commit26b49c54afb9868115e495098ce69f2d2487c932 (patch)
tree9b0fb3d3c22ed4223839da3a40c5e71bf0f29174 /Alc
parent1e8ea59564d4082e164f2a7707df90b00f48a35b (diff)
Store the resampler as part of the source
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c2
-rw-r--r--Alc/mixer.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 065371d1..baa94148 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -455,6 +455,7 @@ static void CalcNonAttnSourceParams(ALvoice *voice, const struct ALvoiceProps *p
else
voice->Step = maxi(fastf2i(Pitch*FRACTIONONE + 0.5f), 1);
BsincPrepare(voice->Step, &voice->ResampleState.bsinc);
+ voice->Resampler = SelectResampler(props->Resampler);
/* Calculate gains */
DryGain = clampf(SourceVolume, MinVolume, MaxVolume);
@@ -1095,6 +1096,7 @@ static void CalcAttnSourceParams(ALvoice *voice, const struct ALvoiceProps *prop
else
voice->Step = maxi(fastf2i(Pitch*FRACTIONONE + 0.5f), 1);
BsincPrepare(voice->Step, &voice->ResampleState.bsinc);
+ voice->Resampler = SelectResampler(props->Resampler);
voice->Flags &= ~(VOICE_IS_HRTF | VOICE_HAS_NFC);
if(Device->Render_Mode == HrtfRender)
diff --git a/Alc/mixer.c b/Alc/mixer.c
index b1d014a7..2070f859 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -53,7 +53,6 @@ enum Resampler ResamplerDefault = LinearResampler;
static MixerFunc MixSamples = Mix_C;
static HrtfMixerFunc MixHrtfSamples = MixHrtf_C;
-static ResamplerFunc ResampleSamples = Resample_point32_C;
MixerFunc SelectMixer(void)
{
@@ -177,7 +176,6 @@ void aluInitMixer(void)
MixHrtfSamples = SelectHrtfMixer();
MixSamples = SelectMixer();
- ResampleSamples = SelectResampler(ResamplerDefault);
}
@@ -295,7 +293,7 @@ ALboolean MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei
IrSize = (Device->HrtfHandle ? Device->HrtfHandle->irSize : 0);
Resample = ((increment == FRACTIONONE && DataPosFrac == 0) ?
- Resample_copy32_C : ResampleSamples);
+ Resample_copy32_C : voice->Resampler);
Counter = (voice->Flags&VOICE_IS_MOVING) ? SamplesToDo : 0;
OutPos = 0;