aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-03-10 01:04:28 -0800
committerChris Robinson <[email protected]>2016-03-10 01:04:28 -0800
commiteffb9d1e35ab3679daa6314ffecfc4d71dc4cdf7 (patch)
tree7f6937dcc519b6f6fdc139a5a4ddf98286db091e /Alc/ALu.c
parenta45715751640992e8caeac8c36b5ecb23ba3c190 (diff)
Keep track of the real output's channel names
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c35
1 files changed, 8 insertions, 27 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 9ca5dd02..8ea74669 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -101,28 +101,6 @@ extern inline void aluMatrixdSet(aluMatrixd *matrix,
ALdouble m30, ALdouble m31, ALdouble m32, ALdouble m33);
-/* NOTE: HRTF and UHJ are set up a bit special in the device. Normally the
- * device's DryBuffer, NumChannels, ChannelName, and Channel fields correspond
- * to the output format, and the DryBuffer is then converted and written to the
- * backend's audio buffer.
- *
- * With HRTF or UHJ, these fields correspond to a virtual format, and the
- * actual output is stored in DryBuffer[NumChannels] for the left channel and
- * DryBuffer[NumChannels+1] for the right. As a final output step,
- * the virtual channels will have HRTF filters or UHJ encoding applied and
- * written to the actual output.
- *
- * Sources that get mixed using HRTF directly (or that want to skip HRTF or UHJ
- * completely) will need to offset the output buffer so that they skip the
- * virtual output and write to the actual output channels. This is the reason
- * you'll see
- *
- * voice->Direct.OutBuffer += voice->Direct.OutChannels;
- * voice->Direct.OutChannels = 2;
- *
- * at various points in the code where HRTF is explicitly used or bypassed.
- */
-
static inline HrtfMixerFunc SelectHrtfMixer(void)
{
#ifdef HAVE_SSE
@@ -587,11 +565,14 @@ ALvoid CalcNonAttnSourceParams(ALvoice *voice, const ALsource *ALSource, const A
{
for(j = 0;j < MAX_OUTPUT_CHANNELS;j++)
voice->Direct.Gains[c].Target[j] = 0.0f;
-
- if(chans[c].channel == FrontLeft)
- voice->Direct.Gains[c].Target[0] = DryGain;
- else if(chans[c].channel == FrontRight)
- voice->Direct.Gains[c].Target[1] = DryGain;
+ for(j = 0;j < Device->RealOut.NumChannels;j++)
+ {
+ if(chans[c].channel == Device->RealOut.ChannelName[j])
+ {
+ voice->Direct.Gains[c].Target[j] = DryGain;
+ break;
+ }
+ }
}
}
else for(c = 0;c < num_channels;c++)