mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-02-16 16:41:30 +00:00
fix device openning mode. defaults to write only, but read/write can be
selected using -sndrw
This commit is contained in:
parent
d97095fe87
commit
f3e7e4d1bc
1 changed files with 4 additions and 1 deletions
|
@ -80,11 +80,14 @@ SNDDMA_Init (void)
|
||||||
struct audio_buf_info info;
|
struct audio_buf_info info;
|
||||||
int caps;
|
int caps;
|
||||||
int retries = 3;
|
int retries = 3;
|
||||||
|
int omode = O_WRONLY;
|
||||||
|
|
||||||
snd_inited = 0;
|
snd_inited = 0;
|
||||||
|
|
||||||
// open /dev/dsp, confirm capability to mmap, and get size of dma buffer
|
// open /dev/dsp, confirm capability to mmap, and get size of dma buffer
|
||||||
audio_fd = open ("/dev/dsp", O_RDWR);
|
if (COM_CheckParm ("-sndrw"))
|
||||||
|
omode = O_RDWR;
|
||||||
|
audio_fd = open ("/dev/dsp", omode);
|
||||||
if (audio_fd < 0) { // Failed open, retry up to 3 times
|
if (audio_fd < 0) { // Failed open, retry up to 3 times
|
||||||
// if it's busy
|
// if it's busy
|
||||||
while ((audio_fd < 0) && retries-- &&
|
while ((audio_fd < 0) && retries-- &&
|
||||||
|
|
Loading…
Reference in a new issue