1 $NetBSD: patch-ac,v 1.5 2003/03/22 05:44:38 dillo Exp $
3 --- audioIO_SunOS.c.orig 1997-05-31 19:47:58.000000000 +0200
4 +++ audioIO_SunOS.c 2007-01-21 04:50:43.135430140 +0100
10 #include <sys/stropts.h>
12 +#include <sys/ioctl.h>
19 /* declare these static to effectively isolate the audio device */
23 static audio_info_t auinfo;
26 @@ -31,13 +35,12 @@ audioOpen(int frequency, int stereo, int
30 - if ((audio_fd = open("/dev/audio",O_RDWR))==-1) {
31 + if ((audio_fd = open("/dev/audio",O_WRONLY))==-1) {
32 die(" unable to open the audio device\n");
34 DB(audio, msg("Audio device opened on %d\n",audio_fd) );
36 - if (ioctl(audio_fd,AUDIO_GETINFO,&auinfo)<0)
37 - die("Unable to get audio info\n");
38 + AUDIO_INITINFO(&auinfo);
40 auinfo.play.precision=16;
41 auinfo.play.encoding=AUDIO_ENCODING_LINEAR;
42 @@ -70,7 +73,7 @@ audioSetVolume(int volume)
44 /* should flush the audio device */
50 DB(audio, msg("audio: flush %d\n",audio_fd) );
51 @@ -91,7 +94,7 @@ audioClose()
52 /* writes count bytes from buffer to the audio device */
53 /* returns the number of bytes actually written */
57 audioWrite(char *buffer, int count)
59 return(write(audio_fd,buffer,count));