comparison src/linuxplay.c @ 282:c42ec1d1cded r21-0b39

Import from CVS: tag r21-0b39
author cvs
date Mon, 13 Aug 2007 10:33:18 +0200
parents c5d627a313b1
children 19dcec799385
comparison
equal deleted inserted replaced
281:090b52736db2 282:c42ec1d1cded
125 125
126 /* Use a global buffer as scratch-pad for possible conversions of the 126 /* Use a global buffer as scratch-pad for possible conversions of the
127 sampling format */ 127 sampling format */
128 unsigned char linuxplay_sndbuf[SNDBUFSZ]; 128 unsigned char linuxplay_sndbuf[SNDBUFSZ];
129 129
130 int mix_fd = -1; 130 static int mix_fd;
131 int audio_vol = -1; 131 static int audio_vol;
132 int audio_fd = -1; 132 static int audio_fd;
133 char *audio_dev = ""; 133 static char *audio_dev = "/dev/dsp";
134 134
135 typedef enum {fmtIllegal,fmtRaw,fmtVoc,fmtWave,fmtSunAudio} fmtType; 135 typedef enum {fmtIllegal,fmtRaw,fmtVoc,fmtWave,fmtSunAudio} fmtType;
136 136
137 /* Intercept SIGINT and SIGHUP in order to close the audio and mixer 137 /* Intercept SIGINT and SIGHUP in order to close the audio and mixer
138 devices before terminating sound output; this requires reliable 138 devices before terminating sound output; this requires reliable
992 warn("Unsupported file format (neither RAW, nor Sun/DECAudio, nor WAVE)"); 992 warn("Unsupported file format (neither RAW, nor Sun/DECAudio, nor WAVE)");
993 return; } 993 return; }
994 994
995 /* The VoxWare-SDK discourages opening /dev/audio; opening /dev/dsp and 995 /* The VoxWare-SDK discourages opening /dev/audio; opening /dev/dsp and
996 properly intializing it via ioctl() is prefered */ 996 properly intializing it via ioctl() is prefered */
997 if ((audio_fd=open((audio_dev="/dev/dsp"), 997 if ((audio_fd=open(audio_dev,
998 (O_WRONLY|O_NDELAY),0)) < 0) { 998 (O_WRONLY|O_NDELAY),0)) < 0) {
999 perror(audio_dev); 999 perror(audio_dev);
1000 if (mix_fd > 0 && mix_fd != audio_fd) { close(mix_fd); mix_fd = -1; } 1000 if (mix_fd > 0 && mix_fd != audio_fd) { close(mix_fd); mix_fd = -1; }
1001 return; } 1001 return; }
1002 1002