freebsd-ports/audio/snd/files/patch-audio_c

74 lines
3.7 KiB
Plaintext

--- audio.c.orig Mon Sep 18 12:08:54 2000
+++ audio.c Fri Oct 6 17:34:16 2000
@@ -1830,7 +1830,7 @@
break;
}
if (audio_out == -1) return(error_exit(MUS_AUDIO_CANT_OPEN,audio_out));
- if (ioctl(audio_out,SNDCTL_DSP_CHANNELS,&chans) == -1) return(error_exit(MUS_AUDIO_CHANNELS_NOT_AVAILABLE,audio_out));
+ if (ioctl(audio_out,SOUND_PCM_READ_CHANNELS,&chans) == -1) return(error_exit(MUS_AUDIO_CHANNELS_NOT_AVAILABLE,audio_out));
return(audio_out);
}
@@ -1844,7 +1844,7 @@
return error_exit(MUS_AUDIO_CANT_OPEN, audio_out);
if ((ioctl(audio_out,SNDCTL_DSP_SETFMT,&oss_format) == -1) || (oss_format != to_oss_format(format)))
return(error_exit(MUS_AUDIO_FORMAT_NOT_AVAILABLE,audio_out));
- if (ioctl(audio_out,SNDCTL_DSP_CHANNELS,&chans) == -1)
+ if (ioctl(audio_out,SOUND_PCM_READ_CHANNELS,&chans) == -1)
return(error_exit(MUS_AUDIO_CHANNELS_NOT_AVAILABLE,audio_out));
if (ioctl(audio_out,SNDCTL_DSP_SPEED,&srate) == -1)
return(error_exit(MUS_AUDIO_SRATE_NOT_AVAILABLE,audio_out));
@@ -1880,7 +1880,7 @@
if ((ioctl(audio_out,SNDCTL_DSP_SETFMT,&oss_format) == -1) || (oss_format != to_oss_format(format)))
return(error_exit(MUS_AUDIO_FORMAT_NOT_AVAILABLE,audio_out));
#ifdef NEW_OSS
- if (ioctl(audio_out,SNDCTL_DSP_CHANNELS,&chans) == -1) return(error_exit(MUS_AUDIO_CHANNELS_NOT_AVAILABLE,audio_out));
+ if (ioctl(audio_out,SOUND_PCM_READ_CHANNELS,&chans) == -1) return(error_exit(MUS_AUDIO_CHANNELS_NOT_AVAILABLE,audio_out));
#else
if (chans == 2) stereo = 1; else stereo = 0;
if ((ioctl(audio_out,SNDCTL_DSP_STEREO,&stereo) == -1) || ((chans == 2) && (stereo == 0))) return(error_exit(MUS_AUDIO_CHANNELS_NOT_AVAILABLE,audio_out));
@@ -1947,7 +1947,7 @@
break;
}
if (audio_fd == -1) return(error_exit(MUS_AUDIO_NO_INPUT_AVAILABLE,-1));
- if (ioctl(audio_fd,SNDCTL_DSP_CHANNELS,&chans) == -1) return(error_exit(MUS_AUDIO_CHANNELS_NOT_AVAILABLE,audio_fd));
+ if (ioctl(audio_fd,SOUND_PCM_READ_CHANNELS,&chans) == -1) return(error_exit(MUS_AUDIO_CHANNELS_NOT_AVAILABLE,audio_fd));
return(audio_fd);
}
@@ -1961,7 +1961,7 @@
return(error_exit(MUS_AUDIO_CANT_OPEN, audio_fd));
if ((ioctl(audio_fd,SNDCTL_DSP_SETFMT,&oss_format) == -1) || (oss_format != to_oss_format(format)))
return(error_exit(MUS_AUDIO_FORMAT_NOT_AVAILABLE,audio_fd));
- if (ioctl(audio_fd,SNDCTL_DSP_CHANNELS,&chans) == -1)
+ if (ioctl(audio_fd,SOUND_PCM_READ_CHANNELS,&chans) == -1)
return(error_exit(MUS_AUDIO_CHANNELS_NOT_AVAILABLE,audio_fd));
if (ioctl(audio_fd,SNDCTL_DSP_SPEED,&srate) == -1)
return(error_exit(MUS_AUDIO_SRATE_NOT_AVAILABLE,audio_fd));
@@ -1992,7 +1992,6 @@
else
{
err = 0;
- err = ioctl(audio_fd,SNDCTL_DSP_SETDUPLEX,&err); /* not always a no-op! */
/* if (err == -1) AUDIO_ERROR = MUS_AUDIO_NO_INPUT_AVAILABLE; */
/* this damned thing returns -1 even when full duplex is available */
}
@@ -2023,7 +2022,7 @@
if ((ioctl(audio_fd,SNDCTL_DSP_SETFMT,&oss_format) == -1) || (oss_format != to_oss_format(format)))
return(error_exit(MUS_AUDIO_FORMAT_NOT_AVAILABLE,audio_fd));
#ifdef NEW_OSS
- if (ioctl(audio_fd,SNDCTL_DSP_CHANNELS,&chans) == -1) return(error_exit(MUS_AUDIO_CHANNELS_NOT_AVAILABLE,audio_fd));
+ if (ioctl(audio_fd,SOUND_PCM_READ_CHANNELS,&chans) == -1) return(error_exit(MUS_AUDIO_CHANNELS_NOT_AVAILABLE,audio_fd));
#else
if (chans == 2) stereo = 1; else stereo = 0;
if ((ioctl(audio_fd,SNDCTL_DSP_STEREO,&stereo) == -1) || ((chans == 2) && (stereo == 0))) return(error_exit(MUS_AUDIO_CHANNELS_NOT_AVAILABLE,audio_fd));
@@ -2467,7 +2466,7 @@
static char *synth_name(int i)
{
- if ((i>0) && (i<=SNDCARD_UART401))
+ if ((i>0) && (i<=SNDCARD_NSS))
return(synth_names[i]);
return("unknown");
}