aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-08-12 15:42:36 -0700
committerChris Robinson <[email protected]>2011-08-12 15:42:36 -0700
commit412cec73de3e127bbfba9f91c9586089217621df (patch)
tree42b6eac24a079727728add68800df5c7badcc07e /Alc/ALu.c
parenta72c0f7470ff76c363810cfaf2a3fd6282cd8cc2 (diff)
Avoid a temporary throw-away buffer for mixing null output
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 1ba71129..fd9b5334 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1101,23 +1101,26 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
}
}
- switch(device->FmtType)
+ if(buffer)
{
- case DevFmtByte:
- Write_ALbyte(device, buffer, SamplesToDo);
- break;
- case DevFmtUByte:
- Write_ALubyte(device, buffer, SamplesToDo);
- break;
- case DevFmtShort:
- Write_ALshort(device, buffer, SamplesToDo);
- break;
- case DevFmtUShort:
- Write_ALushort(device, buffer, SamplesToDo);
- break;
- case DevFmtFloat:
- Write_ALfloat(device, buffer, SamplesToDo);
- break;
+ switch(device->FmtType)
+ {
+ case DevFmtByte:
+ Write_ALbyte(device, buffer, SamplesToDo);
+ break;
+ case DevFmtUByte:
+ Write_ALubyte(device, buffer, SamplesToDo);
+ break;
+ case DevFmtShort:
+ Write_ALshort(device, buffer, SamplesToDo);
+ break;
+ case DevFmtUShort:
+ Write_ALushort(device, buffer, SamplesToDo);
+ break;
+ case DevFmtFloat:
+ Write_ALfloat(device, buffer, SamplesToDo);
+ break;
+ }
}
size -= SamplesToDo;