mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-21 19:51:18 +00:00
sadly, that just does not work
This commit is contained in:
parent
a90f8132a7
commit
eb974c6dcb
1 changed files with 3 additions and 9 deletions
|
@ -80,23 +80,17 @@ SNDDMA_Init (void)
|
|||
struct audio_buf_info info;
|
||||
int caps;
|
||||
int retries = 3;
|
||||
int omode = O_WRONLY;
|
||||
int mmmode = PROT_WRITE;
|
||||
|
||||
snd_inited = 0;
|
||||
|
||||
// open /dev/dsp, confirm capability to mmap, and get size of dma buffer
|
||||
if (COM_CheckParm ("-sndrw")) {
|
||||
omode = O_RDWR;
|
||||
mmmode |= PROT_READ;
|
||||
}
|
||||
audio_fd = open ("/dev/dsp", omode);
|
||||
audio_fd = open ("/dev/dsp", 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 ("/dev/dsp", omode);
|
||||
audio_fd = open ("/dev/dsp", O_RDWR);
|
||||
}
|
||||
if (audio_fd < 0) {
|
||||
perror ("/dev/dsp");
|
||||
|
@ -183,7 +177,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) {
|
||||
|
|
Loading…
Reference in a new issue