diff options
author | Chris Robinson <[email protected]> | 2016-03-11 20:59:12 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-03-11 20:59:12 -0800 |
commit | 22abaa287d7c10fb1ae8ae34b32d5e0ebbbfad78 (patch) | |
tree | d2bc8ff92512024e5fefae19ca6ed6208ad1e61d /Alc/mixer.c | |
parent | 532897219326e5ee47eb08810734b2f2ed4409a3 (diff) |
Use the real output's left and right channels with HRTF
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r-- | Alc/mixer.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c index 779d69e0..44495d72 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -603,6 +603,8 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam else { MixHrtfParams hrtfparams; + int lidx, ridx; + if(!Counter) { parms->Hrtf[chan].Current = parms->Hrtf[chan].Target; @@ -633,7 +635,11 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam hrtfparams.Target = &parms->Hrtf[chan].Target; hrtfparams.Current = &parms->Hrtf[chan].Current; - MixHrtfSamples(parms->OutBuffer, samples, Counter, voice->Offset, + lidx = GetChannelIdxByName(Device->RealOut, FrontLeft); + ridx = GetChannelIdxByName(Device->RealOut, FrontRight); + assert(lidx != -1 && ridx != -1); + + MixHrtfSamples(parms->OutBuffer, lidx, ridx, samples, Counter, voice->Offset, OutPos, IrSize, &hrtfparams, &parms->Hrtf[chan].State, DstBufferSize); } |