diff options
author | Chris Robinson <[email protected]> | 2017-04-21 00:06:40 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-04-21 00:06:40 -0700 |
commit | 26b49c54afb9868115e495098ce69f2d2487c932 (patch) | |
tree | 9b0fb3d3c22ed4223839da3a40c5e71bf0f29174 /Alc | |
parent | 1e8ea59564d4082e164f2a7707df90b00f48a35b (diff) |
Store the resampler as part of the source
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALu.c | 2 | ||||
-rw-r--r-- | Alc/mixer.c | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -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; |