diff options
author | Chris Robinson <[email protected]> | 2016-03-10 22:56:44 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-03-10 22:56:44 -0800 |
commit | 859cc703e75c2699531f041ccd3e8169d44bea50 (patch) | |
tree | 193eb51b9d99fe4e4b0173619711ca16b7716f7a /Alc/ALu.c | |
parent | d648486bcd431b34ad68b76db400ff7e963c72e2 (diff) |
Use the proper left and right channels for UHJ output
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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) { |