35 lines
967 B
Text
35 lines
967 B
Text
$NetBSD: patch-ab,v 1.3 2006/06/17 06:37:55 dsainty Exp $
|
|
|
|
Make sure ioctl() gets a third dummy argument, for the three argument macro
|
|
defined in the NetBSD OSS emulation soundcard.h.
|
|
|
|
rand() is too weak to generate quality white noise, use random() instead.
|
|
|
|
--- src/SoundOSS.c.orig 2002-01-16 04:46:43.000000000 +1300
|
|
+++ src/SoundOSS.c 2006-06-03 18:25:08.000000000 +1200
|
|
@@ -106,7 +106,7 @@
|
|
return;
|
|
}
|
|
|
|
- if ( ioctl ( SoundFD, SNDCTL_DSP_RESET ) < 0 ) {
|
|
+ if ( ioctl ( SoundFD, SNDCTL_DSP_RESET, &dummy ) < 0 ) {
|
|
fprintf ( stderr, "Can't reset sound device\n" );
|
|
return;
|
|
}
|
|
@@ -328,13 +328,13 @@
|
|
SampleState[c] ^= 1;
|
|
else {
|
|
if ( SoundFb )
|
|
- SampleState[c] = rand() & 1;
|
|
+ SampleState[c] = random() & 1;
|
|
else {
|
|
if ( pnoise++ == 10240 ) {
|
|
- srand(time(0));
|
|
+ srandom(time(0));
|
|
pnoise = 0;
|
|
}
|
|
- SampleState[c] = rand() & 1;
|
|
+ SampleState[c] = random() & 1;
|
|
}
|
|
}
|
|
}
|