- 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:
Jamie Wilkinson 2002-12-01 04:17:16 +00:00
parent f1913fdc22
commit 86fdb54929

View file

@ -774,8 +774,18 @@ void S_ClearBuffer (void)
clear = 0; clear = 0;
SNDDMA_BeginPainting (); SNDDMA_BeginPainting ();
if (dma.buffer) if (dma.buffer) {
memset(dma.buffer, clear, dma.samples * dma.samplebits/8); /* 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 (); SNDDMA_Submit ();
} }