mirror of
https://git.code.sf.net/p/quake/quake2forge
synced 2024-12-12 13:42:21 +00:00
- Disabled using memset on sound buffer since it may be
read-only. In future, one may want to test for this case and use memset if the buffer is writeable. (icculus patchset #11)
This commit is contained in:
parent
f1913fdc22
commit
86fdb54929
1 changed files with 12 additions and 2 deletions
|
@ -774,8 +774,18 @@ void S_ClearBuffer (void)
|
|||
clear = 0;
|
||||
|
||||
SNDDMA_BeginPainting ();
|
||||
if (dma.buffer)
|
||||
memset(dma.buffer, clear, dma.samples * dma.samplebits/8);
|
||||
if (dma.buffer) {
|
||||
/* buffer may be read-only, clear manually */
|
||||
/* memset(dma.buffer, clear, dma.samples * dma.samplebits/8); */
|
||||
int i;
|
||||
unsigned char * ptr = (unsigned char *) dma.buffer;
|
||||
|
||||
i = dma.samples * dma.samplebits/8;
|
||||
while (i--) {
|
||||
*ptr = clear;
|
||||
ptr++;
|
||||
}
|
||||
}
|
||||
SNDDMA_Submit ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue