60 lines
1.4 KiB
Plaintext
60 lines
1.4 KiB
Plaintext
$NetBSD: patch-ac,v 1.6 2007/01/21 04:02:01 rillig Exp $
|
|
|
|
--- audioIO_SunOS.c.orig 1997-05-31 19:47:58.000000000 +0200
|
|
+++ audioIO_SunOS.c 2007-01-21 04:50:43.135430140 +0100
|
|
@@ -8,7 +8,11 @@
|
|
|
|
#include "amp.h"
|
|
#include <sys/types.h>
|
|
+#ifndef OS_NetBSD
|
|
#include <sys/stropts.h>
|
|
+#else
|
|
+#include <sys/ioctl.h>
|
|
+#endif
|
|
#include <fcntl.h>
|
|
#include <unistd.h>
|
|
#include <stdio.h>
|
|
@@ -18,7 +22,7 @@
|
|
|
|
/* declare these static to effectively isolate the audio device */
|
|
|
|
-static audio_fd;
|
|
+static int audio_fd;
|
|
static audio_info_t auinfo;
|
|
|
|
/* audioOpen() */
|
|
@@ -31,13 +35,12 @@ audioOpen(int frequency, int stereo, int
|
|
{
|
|
int res;
|
|
|
|
- if ((audio_fd = open("/dev/audio",O_RDWR))==-1) {
|
|
+ if ((audio_fd = open("/dev/audio",O_WRONLY))==-1) {
|
|
die(" unable to open the audio device\n");
|
|
}
|
|
DB(audio, msg("Audio device opened on %d\n",audio_fd) );
|
|
|
|
- if (ioctl(audio_fd,AUDIO_GETINFO,&auinfo)<0)
|
|
- die("Unable to get audio info\n");
|
|
+ AUDIO_INITINFO(&auinfo);
|
|
|
|
auinfo.play.precision=16;
|
|
auinfo.play.encoding=AUDIO_ENCODING_LINEAR;
|
|
@@ -70,7 +73,7 @@ audioSetVolume(int volume)
|
|
/* audioFlush() */
|
|
/* should flush the audio device */
|
|
|
|
-inline void
|
|
+void
|
|
audioFlush()
|
|
{
|
|
DB(audio, msg("audio: flush %d\n",audio_fd) );
|
|
@@ -91,7 +94,7 @@ audioClose()
|
|
/* writes count bytes from buffer to the audio device */
|
|
/* returns the number of bytes actually written */
|
|
|
|
-int inline
|
|
+int
|
|
audioWrite(char *buffer, int count)
|
|
{
|
|
return(write(audio_fd,buffer,count));
|