diff options
author | Kiriyama Kazuhiko <kiri@FreeBSD.org> | 2001-06-07 02:00:57 +0000 |
---|---|---|
committer | Kiriyama Kazuhiko <kiri@FreeBSD.org> | 2001-06-07 02:00:57 +0000 |
commit | c422afbe87c53e1fc5d798ed61dcdbe8c9fdedad (patch) | |
tree | fc51a4a4adbdf5935323b423ca6623c42bc95f4e /mbone/rat30/files/patch-aa | |
parent | Update to 4142 (diff) |
New port for RAT(network audio tool) version 3.
PR: 21356
Submitted by:Takeshi MUTOH <mutoh@bovine.info.nara-k.ac.jp>
Notes
Notes:
svn path=/head/; revision=43573
Diffstat (limited to 'mbone/rat30/files/patch-aa')
-rw-r--r-- | mbone/rat30/files/patch-aa | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/mbone/rat30/files/patch-aa b/mbone/rat30/files/patch-aa new file mode 100644 index 000000000000..83e874042ceb --- /dev/null +++ b/mbone/rat30/files/patch-aa @@ -0,0 +1,69 @@ +*** src/auddev_freebsd.c.orig Wed Mar 24 16:22:19 1999 +--- src/auddev_freebsd.c Sat Sep 16 00:03:22 2000 +*************** +*** 89,102 **** + } + if ((ioctl(audio_fd, SNDCTL_DSP_SETFMT, &mode) == -1) || (mode != AFMT_S16_LE)) { + printf("Device doesn't support 16bit linear format!\n"); + return -1; + } + if ((ioctl(audio_fd, SNDCTL_DSP_STEREO, &stereo) == -1) || (stereo != 0)) { + printf("Device doesn't support mono!\n"); + return -1; + } +! if ((ioctl(audio_fd, SNDCTL_DSP_SPEED, &speed) == -1) || (speed != 8000)) { + printf("Device doesn't support 8kHz sampling!\n"); + return -1; + } + +--- 89,106 ---- + } + if ((ioctl(audio_fd, SNDCTL_DSP_SETFMT, &mode) == -1) || (mode != AFMT_S16_LE)) { + printf("Device doesn't support 16bit linear format!\n"); ++ close(audio_fd); + return -1; + } + if ((ioctl(audio_fd, SNDCTL_DSP_STEREO, &stereo) == -1) || (stereo != 0)) { + printf("Device doesn't support mono!\n"); ++ close(audio_fd); + return -1; + } +! // if ((ioctl(audio_fd, SNDCTL_DSP_SPEED, &speed) == -1) || (speed != 8000)) { +! if (ioctl(audio_fd, SNDCTL_DSP_SPEED, &speed) == -1){ + printf("Device doesn't support 8kHz sampling!\n"); ++ close(audio_fd); + return -1; + } + +*************** +*** 158,163 **** +--- 162,168 ---- + * be open to do this, so if we're passed -1 as a file-descriptor we open + * the device, do the ioctl, and then close it again... + */ ++ /* + snd_chan_param scp; + if (audio_fd == -1) { + audio_fd = audio_open_rw(O_RDONLY); +*************** +*** 174,179 **** +--- 179,197 ---- + if (ioctl(audio_fd, AIOSFMT, 0) == -1) { + return FALSE; + } ++ */ ++ int caps; ++ int was_defined = 1; ++ if (audio_fd == -1) { ++ audio_fd = audio_open_rw(O_RDWR); ++ was_defined = 0; ++ } ++ ioctl(audio_fd, SNDCTL_DSP_GETCAPS, &caps); ++ if ((caps & DSP_CAP_DUPLEX) == 0) { ++ if( was_defined == 0 ) audio_close(audio_fd); ++ return FALSE; ++ } ++ if( was_defined == 0 ) audio_close(audio_fd); + return TRUE; + } + |