diff options
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r-- | OpenAL32/alSource.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index c4c0bfb1..55a4aae1 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -3084,6 +3084,7 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state) voice->Step = 0; voice->Moving = AL_FALSE; + voice->Flags = 0; for(i = 0;i < MAX_INPUT_CHANNELS;i++) { ALsizei j; @@ -3095,6 +3096,17 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state) voice->Direct.Params[i].Hrtf.State.Values[j][1] = 0.0f; } } + if(device->AvgSpeakerDist > 0.0f) + { + ALfloat w1 = SPEEDOFSOUNDMETRESPERSEC / + (device->AvgSpeakerDist * device->Frequency); + for(i = 0;i < voice->NumChannels;i++) + { + NfcFilterCreate1(&voice->Direct.Params[i].NFCtrlFilter[0], 0.0f, w1); + NfcFilterCreate2(&voice->Direct.Params[i].NFCtrlFilter[1], 0.0f, w1); + NfcFilterCreate3(&voice->Direct.Params[i].NFCtrlFilter[2], 0.0f, w1); + } + } ATOMIC_STORE(&voice->Source, Source, almemory_order_relaxed); ATOMIC_STORE(&voice->Playing, true, almemory_order_release); |