abandon the oss write only attempts.

This commit is contained in:
Bill Currie 2001-05-21 17:40:12 +00:00
parent 92fe3791e2
commit a79ab3faf8
3 changed files with 3 additions and 15 deletions

View file

@ -182,7 +182,6 @@ extern cvar_t *bgmvolume;
extern cvar_t *volume;
extern cvar_t *snd_device;
extern cvar_t *snd_oss_rw;
extern cvar_t *snd_rate;
extern cvar_t *snd_bits;
extern cvar_t *snd_stereo;

View file

@ -108,7 +108,6 @@ extern cvar_t *bgmvolume;
extern cvar_t *volume;
cvar_t *snd_device;
cvar_t *snd_oss_rw;
cvar_t *snd_rate;
cvar_t *snd_bits;
cvar_t *snd_stereo;
@ -285,9 +284,6 @@ I_S_Init_Cvars (void)
{
snd_device = Cvar_Get ("snd_device", "", CVAR_ROM, NULL,
"sound device. \"\" is system default");
snd_oss_rw = Cvar_Get ("snd_oss_rw", "0", CVAR_ROM, NULL,
"open the oss device in r/w mode instead of w/o"
" (for braindead(?) drivers)");
snd_rate = Cvar_Get ("snd_rate", "0", CVAR_ROM, NULL,
"sound playback rate. 0 is system default");
snd_bits = Cvar_Get ("snd_bits", "0", CVAR_ROM, NULL,

View file

@ -107,8 +107,6 @@ SNDDMA_Init (void)
struct audio_buf_info info;
int caps;
int retries = 3;
int omode = O_WRONLY;
int mmmode = PROT_WRITE;
snd_inited = 0;
@ -116,18 +114,13 @@ SNDDMA_Init (void)
if (snd_device->string[0])
snd_dev = snd_device->string;
if (snd_oss_rw->int_val) {
omode = O_RDWR;
mmmode |= PROT_READ;
}
audio_fd = open (snd_dev, omode);
audio_fd = open (snd_dev, O_RDWR);
if (audio_fd < 0) { // Failed open, retry up to 3 times
// if it's busy
while ((audio_fd < 0) && retries-- &&
((errno == EAGAIN) || (errno == EBUSY))) {
sleep (1);
audio_fd = open (snd_dev, omode);
audio_fd = open (snd_dev, O_RDWR);
}
if (audio_fd < 0) {
perror (snd_dev);
@ -202,7 +195,7 @@ SNDDMA_Init (void)
// memory map the dma buffer
shm->buffer = (unsigned char *) mmap (NULL, info.fragstotal
* info.fragsize,
mmmode,
PROT_READ | PROT_WRITE,
MAP_FILE | MAP_SHARED, audio_fd, 0);
if (shm->buffer == MAP_FAILED) {