aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-03-12 18:27:25 -0700
committerChris Robinson <[email protected]>2012-03-12 18:27:25 -0700
commit335232207dce93e4f74e2d03230dc67626ebd347 (patch)
tree570df8da9a9001c00731f814e9021f6d687aa67c
parent93e71f0554d08b515aecd42d795cd62a980ff791 (diff)
With DirectChannels enabled, don't try to mix channels that have no matching output
-rw-r--r--Alc/ALu.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 5a53dbba..365aa55d 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -250,7 +250,17 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
if(DirectChannels != AL_FALSE)
{
for(c = 0;c < num_channels;c++)
- SrcMatrix[c][chans[c].channel] += DryGain * ListenerGain;
+ {
+ for(i = 0;i < (ALint)Device->NumChan;i++)
+ {
+ enum Channel chan = Device->Speaker2Chan[i];
+ if(chan == chans[c].channel)
+ {
+ SrcMatrix[c][chan] += DryGain * ListenerGain;
+ break;
+ }
+ }
+ }
}
else if(Device->Hrtf)
{