Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / audio / amp / patches / patch-ac
blobe2ac579d94c00d42b24210109b50c7f2d065400e
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
5 @@ -8,7 +8,11 @@
6  
7  #include "amp.h"
8  #include <sys/types.h>
9 +#ifndef OS_NetBSD
10  #include <sys/stropts.h>
11 +#else
12 +#include <sys/ioctl.h>
13 +#endif
14  #include <fcntl.h>
15  #include <unistd.h>
16  #include <stdio.h>
17 @@ -18,7 +22,7 @@
19  /* declare these static to effectively isolate the audio device */
21 -static audio_fd;
22 +static int audio_fd;
23  static audio_info_t auinfo;
25  /* audioOpen() */
26 @@ -31,13 +35,12 @@ audioOpen(int frequency, int stereo, int
27  {
28         int res;
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");
33         }
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)
43  /* audioFlush() */
44  /* should flush the audio device */
46 -inline void
47 +void
48  audioFlush()
49  {
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 */
55 -int inline
56 +int
57  audioWrite(char *buffer, int count)
58  {
59         return(write(audio_fd,buffer,count));