aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-03-10 22:56:44 -0800
committerChris Robinson <[email protected]>2016-03-10 22:56:44 -0800
commit859cc703e75c2699531f041ccd3e8169d44bea50 (patch)
tree193eb51b9d99fe4e4b0173619711ca16b7716f7a /Alc/ALu.c
parentd648486bcd431b34ad68b76db400ff7e963c72e2 (diff)
Use the proper left and right channels for UHJ output
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index eb7afd90..17c91e52 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1473,9 +1473,16 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
{
if(device->Uhj_Encoder)
{
- /* Encode to stereo-compatible 2-channel UHJ output. */
- EncodeUhj2(device->Uhj_Encoder, device->RealOut.Buffer,
- device->VirtOut.Buffer, SamplesToDo);
+ int lidx = GetChannelIdxByName(device->RealOut, FrontLeft);
+ int ridx = GetChannelIdxByName(device->RealOut, FrontRight);
+ if(lidx != -1 && ridx != -1)
+ {
+ /* Encode to stereo-compatible 2-channel UHJ output. */
+ EncodeUhj2(device->Uhj_Encoder,
+ device->RealOut.Buffer[lidx], device->RealOut.Buffer[ridx],
+ device->VirtOut.Buffer, SamplesToDo
+ );
+ }
}
if(device->Bs2b)
{