summaryrefslogtreecommitdiff
path: root/mbone
diff options
context:
space:
mode:
Diffstat (limited to 'mbone')
-rw-r--r--mbone/rat/Makefile10
-rw-r--r--mbone/rat/files/md54
-rw-r--r--mbone/rat/patches/patch-aa857
-rw-r--r--mbone/rat/patches/patch-ab9
-rw-r--r--mbone/rat/patches/patch-ac9
-rw-r--r--mbone/rat/patches/patch-ad85
-rw-r--r--mbone/rat/patches/patch-ae7
-rw-r--r--mbone/rat/patches/patch-af29
-rw-r--r--mbone/rat/patches/patch-ag43
-rw-r--r--mbone/rat/patches/patch-ah7
10 files changed, 527 insertions, 533 deletions
diff --git a/mbone/rat/Makefile b/mbone/rat/Makefile
index febcc0ae774..7e1d8dd07a1 100644
--- a/mbone/rat/Makefile
+++ b/mbone/rat/Makefile
@@ -1,15 +1,17 @@
-# $NetBSD: Makefile,v 1.8 1998/09/13 17:06:08 garbled Exp $
+# $NetBSD: Makefile,v 1.9 1998/11/05 02:46:09 mycroft Exp $
#
-DISTNAME= rat-3.0.24
+DISTNAME= rat-3.0.28
CATEGORIES= mbone
-MASTER_SITES= ftp://cs.ucl.ac.uk/mice/rat/src/
+MASTER_SITES= http://www-mice.cs.ucl.ac.uk/multimedia/software/rat/3.0.28/
MAINTAINER= mycroft@netbsd.org
-HOMEPAGE= http://www.cs.ucl.ac.uk/mice/rat/
+HOMEPAGE= http://www-mice.cs.ucl.ac.uk/multimedia/software/rat/
DEPENDS+= tk-8.0p2:../../x11/tk80
+CONFLICTS= rat-3.0.24
+
RESTRICTED= "Contains DES encryption"
MIRROR_DISTFILE=no
USE_GMAKE= yes
diff --git a/mbone/rat/files/md5 b/mbone/rat/files/md5
index 6a7191fe8af..b3fccb31076 100644
--- a/mbone/rat/files/md5
+++ b/mbone/rat/files/md5
@@ -1,3 +1,3 @@
-$NetBSD: md5,v 1.3 1998/08/07 13:25:03 agc Exp $
+$NetBSD: md5,v 1.4 1998/11/05 02:46:09 mycroft Exp $
-MD5 (rat-3.0.24.tar.gz) = a9eb3d58f0e9ec5514e2658abfc0d497
+MD5 (rat-3.0.28.tar.gz) = 02a252ebbcda680a0f4079181b8970f2
diff --git a/mbone/rat/patches/patch-aa b/mbone/rat/patches/patch-aa
index 965222bc7ab..5842e547631 100644
--- a/mbone/rat/patches/patch-aa
+++ b/mbone/rat/patches/patch-aa
@@ -1,429 +1,428 @@
-$NetBSD: patch-aa,v 1.4 1998/09/13 17:06:09 garbled Exp $
-*** /dev/null Thu Mar 5 16:59:30 1998
---- src/auddev_netbsd.c Thu Mar 5 16:40:41 1998
-***************
-*** 0 ****
---- 1,423 ----
-+ /*
-+ * FILE: netbsd.c
-+ * PROGRAM: RAT
-+ * AUTHOR: Isidor Kouvelas
-+ * MODIFIED: Colin Perkins
-+ *
-+ * $Revision: 1.4 $
-+ * $Date: 1998/09/13 17:06:09 $
-+ *
-+ * Copyright (c) 1995,1996 University College London
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, is permitted, for non-commercial use only, provided
-+ * that the following conditions are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ * 3. All advertising materials mentioning features or use of this software
-+ * must display the following acknowledgement:
-+ * This product includes software developed by the Computer Science
-+ * Department at University College London
-+ * 4. Neither the name of the University nor of the Department may be used
-+ * to endorse or promote products derived from this software without
-+ * specific prior written permission.
-+ * Use of this software for commercial purposes is explicitly forbidden
-+ * unless prior written permission is obtained from the authors.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+
-+
-+ #include "assert.h"
-+ #include "bat_include.h"
-+ #ifdef __NetBSD__
-+
-+ static audio_info_t dev_info;
-+ static int mulaw_device = FALSE; /* TRUE if the hardware can only do 8bit mulaw sampling */
-+
-+ #define bat_to_device(x) ((x) * AUDIO_MAX_GAIN / MAX_AMP)
-+ #define device_to_bat(x) ((x) * MAX_AMP / AUDIO_MAX_GAIN)
-+
-+ /* Try to open the audio device. */
-+ /* Returns a valid file descriptor if ok, -1 otherwise. */
-+ int
-+ audio_open(audio_format format)
-+ {
-+ audio_info_t tmp_info;
-+
-+ int audio_fd = open("/dev/audio", O_RDWR | O_NDELAY);
-+
-+ if (audio_fd > 0) {
-+ AUDIO_INITINFO(&dev_info);
-+ dev_info.monitor_gain = 0;
-+ dev_info.play.sample_rate = format.sample_rate;
-+ dev_info.record.sample_rate = format.sample_rate;
-+ dev_info.play.channels = format.num_channels;
-+ dev_info.record.channels = format.num_channels;
-+ dev_info.play.precision = format.bits_per_sample;
-+ dev_info.record.precision = format.bits_per_sample;
-+ dev_info.play.gain = (AUDIO_MAX_GAIN - AUDIO_MIN_GAIN) * 0.75;
-+ dev_info.record.gain = (AUDIO_MAX_GAIN - AUDIO_MIN_GAIN) * 0.75;
-+ dev_info.play.port = AUDIO_HEADPHONE;
-+ dev_info.record.port = AUDIO_MICROPHONE;
-+ dev_info.play.balance = AUDIO_MID_BALANCE;
-+ dev_info.record.balance = AUDIO_MID_BALANCE;
-+ #ifdef SunOS_5
-+ dev_info.play.buffer_size = DEVICE_BUF_UNIT;
-+ dev_info.record.buffer_size = DEVICE_BUF_UNIT;
-+ #endif
-+ switch (format.encoding) {
-+ case DEV_PCMU:
-+ dev_info.record.encoding = AUDIO_ENCODING_ULAW;
-+ dev_info.play.encoding = AUDIO_ENCODING_ULAW;
-+ break;
-+ case DEV_L8:
-+ assert(format.bits_per_sample == 8);
-+ dev_info.record.encoding = AUDIO_ENCODING_LINEAR;
-+ dev_info.play.encoding = AUDIO_ENCODING_LINEAR;
-+ break;
-+ case DEV_L16:
-+ assert(format.bits_per_sample == 16);
-+ dev_info.record.encoding = AUDIO_ENCODING_LINEAR;
-+ dev_info.play.encoding = AUDIO_ENCODING_LINEAR;
-+ break;
-+ default:
-+ printf("ERROR: Unknown audio encoding in audio_open!\n");
-+ abort();
-+ }
-+
-+ memcpy(&tmp_info, &dev_info, sizeof(audio_info_t));
-+ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&tmp_info) < 0) {
-+ if (format.encoding == DEV_L16) {
-+ #ifdef DEBUG
-+ printf("Old hardware detected: can't do 16 bit audio, trying 8 bit...\n");
-+ #endif
-+ dev_info.play.precision = 8;
-+ dev_info.record.precision = 8;
-+ dev_info.record.encoding = AUDIO_ENCODING_ULAW;
-+ dev_info.play.encoding = AUDIO_ENCODING_ULAW;
-+ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&dev_info) < 0) {
-+ perror("Setting MULAW audio paramterts");
-+ return -1;
-+ }
-+ mulaw_device = TRUE;
-+ } else {
-+ perror("Setting audio paramterts");
-+ return -1;
-+ }
-+ }
-+ return audio_fd;
-+ } else {
-+ /* Because we opened the device with O_NDELAY
-+ * the waiting flag was not updated so update
-+ * it manually using the audioctl device...
-+ */
-+ audio_fd = open("/dev/audioctl", O_RDWR);
-+ AUDIO_INITINFO(&dev_info);
-+ dev_info.play.waiting = 1;
-+ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&dev_info) < 0) {
-+ #ifdef DEBUG
-+ perror("Setting requests");
-+ #endif
-+ }
-+ close(audio_fd);
-+ return -1;
-+ }
-+ }
-+
-+ /* Close the audio device */
-+ void
-+ audio_close(int audio_fd)
-+ {
-+ close(audio_fd);
-+ audio_fd = -1;
-+ }
-+
-+ /* Flush input buffer */
-+ void
-+ audio_drain(int audio_fd)
-+ {
-+ ioctl(audio_fd, AUDIO_FLUSH, 0);
-+ }
-+
-+ /* Gain and volume values are in the range 0 - MAX_AMP */
-+
-+ void
-+ audio_set_gain(int audio_fd, int gain)
-+ {
-+ if (audio_fd <= 0)
-+ return;
-+
-+ AUDIO_INITINFO(&dev_info);
-+ dev_info.record.gain = bat_to_device(gain);
-+ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&dev_info) < 0)
-+ perror("Setting gain");
-+ }
-+
-+ int
-+ audio_get_gain(int audio_fd)
-+ {
-+ if (audio_fd <= 0)
-+ return (0);
-+
-+ AUDIO_INITINFO(&dev_info);
-+ if (ioctl(audio_fd, AUDIO_GETINFO, (caddr_t)&dev_info) < 0)
-+ perror("Getting gain");
-+ return (device_to_bat(dev_info.record.gain));
-+ }
-+
-+ void
-+ audio_set_volume(int audio_fd, int vol)
-+ {
-+ if (audio_fd <= 0)
-+ return;
-+
-+ AUDIO_INITINFO(&dev_info);
-+ dev_info.play.gain = bat_to_device(vol);
-+ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&dev_info) < 0)
-+ perror("Setting volume");
-+ }
-+
-+ int
-+ audio_get_volume(int audio_fd)
-+ {
-+ if (audio_fd <= 0)
-+ return (0);
-+
-+ AUDIO_INITINFO(&dev_info);
-+ if (ioctl(audio_fd, AUDIO_GETINFO, (caddr_t)&dev_info) < 0)
-+ perror("Getting gain");
-+ return (device_to_bat(dev_info.play.gain));
-+ }
-+
-+ int
-+ audio_read(int audio_fd, sample *buf, int samples)
-+ {
-+ int i, len;
-+ static u_char mulaw_buf[DEVICE_REC_BUF];
-+ u_char *p;
-+
-+ if (mulaw_device) {
-+ if ((len = read(audio_fd, mulaw_buf, samples)) < 0) {
-+ return 0;
-+ } else {
-+ p = mulaw_buf;
-+ for (i = 0; i < len; i++) {
-+ *buf++ = u2s((unsigned)*p);
-+ p++;
-+ }
-+ return (len);
-+ }
-+ } else {
-+ if ((len = read(audio_fd, (char *)buf, samples * BYTES_PER_SAMPLE)) < 0) {
-+ return 0;
-+ } else {
-+ return (len / BYTES_PER_SAMPLE);
-+ }
-+ }
-+ }
-+
-+ int
-+ audio_write(int audio_fd, sample *buf, int samples)
-+ {
-+ int i, done, len, bps;
-+ unsigned char *p, *q;
-+ static u_char mulaw_buf[DEVICE_REC_BUF];
-+
-+ if (mulaw_device) {
-+ p = mulaw_buf;
-+ for (i = 0; i < samples; i++)
-+ *p++ = lintomulaw[(unsigned short)*buf++];
-+ p = mulaw_buf;
-+ len = samples;
-+ bps = 1;
-+ } else {
-+ p = (char *)buf;
-+ len = samples * BYTES_PER_SAMPLE;
-+ bps = BYTES_PER_SAMPLE;
-+ }
-+
-+ q = p;
-+ while (1) {
-+ if ((done = write(audio_fd, p, len)) == len)
-+ break;
-+ if (errno != EINTR)
-+ return (samples - ((len - done) / bps));
-+ len -= done;
-+ p += done;
-+ }
-+
-+ return (samples);
-+ }
-+
-+ /* Set ops on audio device to be non-blocking */
-+ void
-+ audio_non_block(int audio_fd)
-+ {
-+ int on = 1;
-+
-+ if (audio_fd <= 0)
-+ return;
-+
-+ if (ioctl(audio_fd, FIONBIO, (char *)&on) < 0)
-+ fprintf(stderr, "Failed to set non blocking mode on audio device!\n");
-+ }
-+
-+ /* Set ops on audio device to block */
-+ void
-+ audio_block(int audio_fd)
-+ {
-+ int on = 0;
-+
-+ if (audio_fd <= 0)
-+ return;
-+
-+ if (ioctl(audio_fd, FIONBIO, (char *)&on) < 0)
-+ fprintf(stderr, "Failed to set blocking mode on audio device!\n");
-+ }
-+
-+ void
-+ audio_set_oport(int audio_fd, int port)
-+ {
-+ if (audio_fd <= 0)
-+ return;
-+
-+ AUDIO_INITINFO(&dev_info);
-+ /* AUDIO_SPEAKER or AUDIO_HEADPHONE */
-+ dev_info.play.port = port;
-+ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&dev_info) < 0)
-+ perror("Setting port");
-+ }
-+
-+ int
-+ audio_get_oport(int audio_fd)
-+ {
-+ if (audio_fd <= 0)
-+ return (AUDIO_SPEAKER);
-+
-+ AUDIO_INITINFO(&dev_info);
-+ if (ioctl(audio_fd, AUDIO_GETINFO, (caddr_t)&dev_info) < 0)
-+ perror("Getting port");
-+ return (dev_info.play.port);
-+ }
-+
-+ int
-+ audio_next_oport(int audio_fd)
-+ {
-+ int port;
-+
-+ if (audio_fd <= 0)
-+ return (AUDIO_SPEAKER);
-+
-+ AUDIO_INITINFO(&dev_info);
-+ if (ioctl(audio_fd, AUDIO_GETINFO, (caddr_t)&dev_info) < 0)
-+ perror("Getting port");
-+
-+
-+ port = dev_info.play.port;
-+ port <<= 1;
-+
-+ /* It is either wrong on some machines or i got something wrong! */
-+ if (dev_info.play.avail_ports < 3)
-+ dev_info.play.avail_ports = 3;
-+
-+ if ((port & dev_info.play.avail_ports) == 0)
-+ port = 1;
-+
-+ AUDIO_INITINFO(&dev_info);
-+ dev_info.play.port = port;
-+ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&dev_info) < 0)
-+ perror("Setting port");
-+
-+ return (port);
-+ }
-+
-+ void
-+ audio_set_iport(int audio_fd, int port)
-+ {
-+ if (audio_fd <= 0)
-+ return;
-+
-+ AUDIO_INITINFO(&dev_info);
-+ dev_info.record.port = port;
-+ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&dev_info) < 0)
-+ perror("Setting port");
-+ }
-+
-+ int
-+ audio_get_iport(int audio_fd)
-+ {
-+ if (audio_fd <= 0)
-+ return (AUDIO_SPEAKER);
-+
-+ AUDIO_INITINFO(&dev_info);
-+ if (ioctl(audio_fd, AUDIO_GETINFO, (caddr_t)&dev_info) < 0)
-+ perror("Getting port");
-+ return (dev_info.record.port);
-+ }
-+
-+ int
-+ audio_next_iport(int audio_fd)
-+ {
-+ int port;
-+
-+ if (audio_fd <= 0)
-+ return (AUDIO_SPEAKER);
-+
-+ AUDIO_INITINFO(&dev_info);
-+ if (ioctl(audio_fd, AUDIO_GETINFO, (caddr_t)&dev_info) < 0)
-+ perror("Getting port");
-+
-+ port = dev_info.record.port;
-+ port <<= 1;
-+
-+ if (dev_info.record.avail_ports > 3)
-+ dev_info.record.avail_ports = 3;
-+
-+ /* Hack to fix Sparc 5 SOLARIS bug */
-+ if ((port & dev_info.record.avail_ports) == 0)
-+ port = 1;
-+
-+ AUDIO_INITINFO(&dev_info);
-+ dev_info.record.port = port;
-+ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&dev_info) < 0)
-+ perror("Setting port");
-+
-+ return (port);
-+ }
-+
-+ void
-+ audio_switch_out(int audio_fd, cushion_struct *ap)
-+ {
-+ /* Full duplex device: do nothing! */
-+ }
-+
-+ void
-+ audio_switch_in(int audio_fd)
-+ {
-+ /* Full duplex device: do nothing! */
-+ }
-+
-+ int
-+ audio_duplex(int audio_fd)
-+ {
-+ return 1;
-+ }
-+
-+ #endif /* __NetBSD__ */
-+
+$NetBSD: patch-aa,v 1.5 1998/11/05 02:46:09 mycroft Exp $
+
+--- /dev/null Wed Nov 4 21:26:51 1998
++++ src/auddev_netbsd.c Wed Nov 4 21:27:03 1998
+@@ -0,0 +1,423 @@
++/*
++ * FILE: netbsd.c
++ * PROGRAM: RAT
++ * AUTHOR: Isidor Kouvelas
++ * MODIFIED: Colin Perkins
++ *
++ * $Revision: 1.5 $
++ * $Date: 1998/11/05 02:46:09 $
++ *
++ * Copyright (c) 1995,1996 University College London
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, is permitted, for non-commercial use only, provided
++ * that the following conditions are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. All advertising materials mentioning features or use of this software
++ * must display the following acknowledgement:
++ * This product includes software developed by the Computer Science
++ * Department at University College London
++ * 4. Neither the name of the University nor of the Department may be used
++ * to endorse or promote products derived from this software without
++ * specific prior written permission.
++ * Use of this software for commercial purposes is explicitly forbidden
++ * unless prior written permission is obtained from the authors.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++
++
++#include "assert.h"
++#include "bat_include.h"
++#ifdef __NetBSD__
++
++static audio_info_t dev_info;
++static int mulaw_device = FALSE; /* TRUE if the hardware can only do 8bit mulaw sampling */
++
++#define bat_to_device(x) ((x) * AUDIO_MAX_GAIN / MAX_AMP)
++#define device_to_bat(x) ((x) * MAX_AMP / AUDIO_MAX_GAIN)
++
++/* Try to open the audio device. */
++/* Returns a valid file descriptor if ok, -1 otherwise. */
++int
++audio_open(audio_format format)
++{
++ audio_info_t tmp_info;
++
++ int audio_fd = open("/dev/audio", O_RDWR | O_NDELAY);
++
++ if (audio_fd > 0) {
++ AUDIO_INITINFO(&dev_info);
++ dev_info.monitor_gain = 0;
++ dev_info.play.sample_rate = format.sample_rate;
++ dev_info.record.sample_rate = format.sample_rate;
++ dev_info.play.channels = format.num_channels;
++ dev_info.record.channels = format.num_channels;
++ dev_info.play.precision = format.bits_per_sample;
++ dev_info.record.precision = format.bits_per_sample;
++ dev_info.play.gain = (AUDIO_MAX_GAIN - AUDIO_MIN_GAIN) * 0.75;
++ dev_info.record.gain = (AUDIO_MAX_GAIN - AUDIO_MIN_GAIN) * 0.75;
++ dev_info.play.port = AUDIO_HEADPHONE;
++ dev_info.record.port = AUDIO_MICROPHONE;
++ dev_info.play.balance = AUDIO_MID_BALANCE;
++ dev_info.record.balance = AUDIO_MID_BALANCE;
++#ifdef SunOS_5
++ dev_info.play.buffer_size = DEVICE_BUF_UNIT;
++ dev_info.record.buffer_size = DEVICE_BUF_UNIT;
++#endif
++ switch (format.encoding) {
++ case DEV_PCMU:
++ dev_info.record.encoding = AUDIO_ENCODING_ULAW;
++ dev_info.play.encoding = AUDIO_ENCODING_ULAW;
++ break;
++ case DEV_L8:
++ assert(format.bits_per_sample == 8);
++ dev_info.record.encoding = AUDIO_ENCODING_LINEAR;
++ dev_info.play.encoding = AUDIO_ENCODING_LINEAR;
++ break;
++ case DEV_L16:
++ assert(format.bits_per_sample == 16);
++ dev_info.record.encoding = AUDIO_ENCODING_LINEAR;
++ dev_info.play.encoding = AUDIO_ENCODING_LINEAR;
++ break;
++ default:
++ printf("ERROR: Unknown audio encoding in audio_open!\n");
++ abort();
++ }
++
++ memcpy(&tmp_info, &dev_info, sizeof(audio_info_t));
++ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&tmp_info) < 0) {
++ if (format.encoding == DEV_L16) {
++#ifdef DEBUG
++ printf("Old hardware detected: can't do 16 bit audio, trying 8 bit...\n");
++#endif
++ dev_info.play.precision = 8;
++ dev_info.record.precision = 8;
++ dev_info.record.encoding = AUDIO_ENCODING_ULAW;
++ dev_info.play.encoding = AUDIO_ENCODING_ULAW;
++ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&dev_info) < 0) {
++ perror("Setting MULAW audio paramterts");
++ return -1;
++ }
++ mulaw_device = TRUE;
++ } else {
++ perror("Setting audio paramterts");
++ return -1;
++ }
++ }
++ return audio_fd;
++ } else {
++ /* Because we opened the device with O_NDELAY
++ * the waiting flag was not updated so update
++ * it manually using the audioctl device...
++ */
++ audio_fd = open("/dev/audioctl", O_RDWR);
++ AUDIO_INITINFO(&dev_info);
++ dev_info.play.waiting = 1;
++ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&dev_info) < 0) {
++#ifdef DEBUG
++ perror("Setting requests");
++#endif
++ }
++ close(audio_fd);
++ return -1;
++ }
++}
++
++/* Close the audio device */
++void
++audio_close(int audio_fd)
++{
++ close(audio_fd);
++ audio_fd = -1;
++}
++
++/* Flush input buffer */
++void
++audio_drain(int audio_fd)
++{
++ ioctl(audio_fd, AUDIO_FLUSH, 0);
++}
++
++/* Gain and volume values are in the range 0 - MAX_AMP */
++
++void
++audio_set_gain(int audio_fd, int gain)
++{
++ if (audio_fd <= 0)
++ return;
++
++ AUDIO_INITINFO(&dev_info);
++ dev_info.record.gain = bat_to_device(gain);
++ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&dev_info) < 0)
++ perror("Setting gain");
++}
++
++int
++audio_get_gain(int audio_fd)
++{
++ if (audio_fd <= 0)
++ return (0);
++
++ AUDIO_INITINFO(&dev_info);
++ if (ioctl(audio_fd, AUDIO_GETINFO, (caddr_t)&dev_info) < 0)
++ perror("Getting gain");
++ return (device_to_bat(dev_info.record.gain));
++}
++
++void
++audio_set_volume(int audio_fd, int vol)
++{
++ if (audio_fd <= 0)
++ return;
++
++ AUDIO_INITINFO(&dev_info);
++ dev_info.play.gain = bat_to_device(vol);
++ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&dev_info) < 0)
++ perror("Setting volume");
++}
++
++int
++audio_get_volume(int audio_fd)
++{
++ if (audio_fd <= 0)
++ return (0);
++
++ AUDIO_INITINFO(&dev_info);
++ if (ioctl(audio_fd, AUDIO_GETINFO, (caddr_t)&dev_info) < 0)
++ perror("Getting gain");
++ return (device_to_bat(dev_info.play.gain));
++}
++
++int
++audio_read(int audio_fd, sample *buf, int samples)
++{
++ int i, len;
++ static u_char mulaw_buf[DEVICE_REC_BUF];
++ u_char *p;
++
++ if (mulaw_device) {
++ if ((len = read(audio_fd, mulaw_buf, samples)) < 0) {
++ return 0;
++ } else {
++ p = mulaw_buf;
++ for (i = 0; i < len; i++) {
++ *buf++ = u2s((unsigned)*p);
++ p++;
++ }
++ return (len);
++ }
++ } else {
++ if ((len = read(audio_fd, (char *)buf, samples * BYTES_PER_SAMPLE)) < 0) {
++ return 0;
++ } else {
++ return (len / BYTES_PER_SAMPLE);
++ }
++ }
++}
++
++int
++audio_write(int audio_fd, sample *buf, int samples)
++{
++ int i, done, len, bps;
++ unsigned char *p, *q;
++ static u_char mulaw_buf[DEVICE_REC_BUF];
++
++ if (mulaw_device) {
++ p = mulaw_buf;
++ for (i = 0; i < samples; i++)
++ *p++ = lintomulaw[(unsigned short)*buf++];
++ p = mulaw_buf;
++ len = samples;
++ bps = 1;
++ } else {
++ p = (char *)buf;
++ len = samples * BYTES_PER_SAMPLE;
++ bps = BYTES_PER_SAMPLE;
++ }
++
++ q = p;
++ while (1) {
++ if ((done = write(audio_fd, p, len)) == len)
++ break;
++ if (errno != EINTR)
++ return (samples - ((len - done) / bps));
++ len -= done;
++ p += done;
++ }
++
++ return (samples);
++}
++
++/* Set ops on audio device to be non-blocking */
++void
++audio_non_block(int audio_fd)
++{
++ int on = 1;
++
++ if (audio_fd <= 0)
++ return;
++
++ if (ioctl(audio_fd, FIONBIO, (char *)&on) < 0)
++ fprintf(stderr, "Failed to set non blocking mode on audio device!\n");
++}
++
++/* Set ops on audio device to block */
++void
++audio_block(int audio_fd)
++{
++ int on = 0;
++
++ if (audio_fd <= 0)
++ return;
++
++ if (ioctl(audio_fd, FIONBIO, (char *)&on) < 0)
++ fprintf(stderr, "Failed to set blocking mode on audio device!\n");
++}
++
++void
++audio_set_oport(int audio_fd, int port)
++{
++ if (audio_fd <= 0)
++ return;
++
++ AUDIO_INITINFO(&dev_info);
++ /* AUDIO_SPEAKER or AUDIO_HEADPHONE */
++ dev_info.play.port = port;
++ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&dev_info) < 0)
++ perror("Setting port");
++}
++
++int
++audio_get_oport(int audio_fd)
++{
++ if (audio_fd <= 0)
++ return (AUDIO_SPEAKER);
++
++ AUDIO_INITINFO(&dev_info);
++ if (ioctl(audio_fd, AUDIO_GETINFO, (caddr_t)&dev_info) < 0)
++ perror("Getting port");
++ return (dev_info.play.port);
++}
++
++int
++audio_next_oport(int audio_fd)
++{
++ int port;
++
++ if (audio_fd <= 0)
++ return (AUDIO_SPEAKER);
++
++ AUDIO_INITINFO(&dev_info);
++ if (ioctl(audio_fd, AUDIO_GETINFO, (caddr_t)&dev_info) < 0)
++ perror("Getting port");
++
++
++ port = dev_info.play.port;
++ port <<= 1;
++
++ /* It is either wrong on some machines or i got something wrong! */
++ if (dev_info.play.avail_ports < 3)
++ dev_info.play.avail_ports = 3;
++
++ if ((port & dev_info.play.avail_ports) == 0)
++ port = 1;
++
++ AUDIO_INITINFO(&dev_info);
++ dev_info.play.port = port;
++ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&dev_info) < 0)
++ perror("Setting port");
++
++ return (port);
++}
++
++void
++audio_set_iport(int audio_fd, int port)
++{
++ if (audio_fd <= 0)
++ return;
++
++ AUDIO_INITINFO(&dev_info);
++ dev_info.record.port = port;
++ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&dev_info) < 0)
++ perror("Setting port");
++}
++
++int
++audio_get_iport(int audio_fd)
++{
++ if (audio_fd <= 0)
++ return (AUDIO_SPEAKER);
++
++ AUDIO_INITINFO(&dev_info);
++ if (ioctl(audio_fd, AUDIO_GETINFO, (caddr_t)&dev_info) < 0)
++ perror("Getting port");
++ return (dev_info.record.port);
++}
++
++int
++audio_next_iport(int audio_fd)
++{
++ int port;
++
++ if (audio_fd <= 0)
++ return (AUDIO_SPEAKER);
++
++ AUDIO_INITINFO(&dev_info);
++ if (ioctl(audio_fd, AUDIO_GETINFO, (caddr_t)&dev_info) < 0)
++ perror("Getting port");
++
++ port = dev_info.record.port;
++ port <<= 1;
++
++ if (dev_info.record.avail_ports > 3)
++ dev_info.record.avail_ports = 3;
++
++ /* Hack to fix Sparc 5 SOLARIS bug */
++ if ((port & dev_info.record.avail_ports) == 0)
++ port = 1;
++
++ AUDIO_INITINFO(&dev_info);
++ dev_info.record.port = port;
++ if (ioctl(audio_fd, AUDIO_SETINFO, (caddr_t)&dev_info) < 0)
++ perror("Setting port");
++
++ return (port);
++}
++
++void
++audio_switch_out(int audio_fd, cushion_struct *ap)
++{
++ /* Full duplex device: do nothing! */
++}
++
++void
++audio_switch_in(int audio_fd)
++{
++ /* Full duplex device: do nothing! */
++}
++
++int
++audio_duplex(int audio_fd)
++{
++ return 1;
++}
++
++#endif /* __NetBSD__ */
++
diff --git a/mbone/rat/patches/patch-ab b/mbone/rat/patches/patch-ab
index ead6a8da087..6aeb627324d 100644
--- a/mbone/rat/patches/patch-ab
+++ b/mbone/rat/patches/patch-ab
@@ -1,9 +1,8 @@
-$NetBSD: patch-ab,v 1.3 1998/09/13 17:06:09 garbled Exp $
-$NetBSD: patch-ab,v 1.3 1998/09/13 17:06:09 garbled Exp $
+$NetBSD: patch-ab,v 1.4 1998/11/05 02:46:09 mycroft Exp $
---- src/ui.c.orig Thu May 22 09:31:59 1997
-+++ src/ui.c Thu Apr 23 10:21:20 1998
-@@ -202,7 +202,7 @@
+--- src/ui.c.orig Tue Sep 22 04:56:20 1998
++++ src/ui.c Wed Nov 4 21:27:03 1998
+@@ -203,7 +203,7 @@
eval_check(interp, comm);
}
diff --git a/mbone/rat/patches/patch-ac b/mbone/rat/patches/patch-ac
index e4ddef46017..969e82fb09c 100644
--- a/mbone/rat/patches/patch-ac
+++ b/mbone/rat/patches/patch-ac
@@ -1,8 +1,9 @@
-$NetBSD: patch-ac,v 1.1 1998/09/13 17:06:09 garbled Exp $
---- src/gsm_code.c.orig Sun Sep 13 08:04:40 1998
-+++ src/gsm_code.c Sun Sep 13 08:05:08 1998
+$NetBSD: patch-ac,v 1.2 1998/11/05 02:46:09 mycroft Exp $
+
+--- src/gsm_code.c.orig Sat Aug 15 15:16:48 1998
++++ src/gsm_code.c Wed Nov 4 21:27:03 1998
@@ -7,6 +7,7 @@
- /* $Header: /cvsroot/pkgsrc/mbone/rat/patches/patch-ac,v 1.1 1998/09/13 17:06:09 garbled Exp $ */
+ /* $Header: /cvsroot/pkgsrc/mbone/rat/patches/patch-ac,v 1.2 1998/11/05 02:46:09 mycroft Exp $ */
#include <stdlib.h>
+#include <string.h>
diff --git a/mbone/rat/patches/patch-ad b/mbone/rat/patches/patch-ad
index 810034649fa..dc69b4bf5ad 100644
--- a/mbone/rat/patches/patch-ad
+++ b/mbone/rat/patches/patch-ad
@@ -1,46 +1,39 @@
-$NetBSD: patch-ad,v 1.1 1998/09/13 17:06:09 garbled Exp $
-*** Build~ Tue May 13 04:38:56 1997
---- Build Thu Mar 5 16:35:38 1998
-***************
-*** 55,59 ****
- Linux ) OSMVER=`echo $OSVERS | awk -F. '{printf("%d_%d", $1, $2)}'`
- ;;
-! SunOS | IRIX | FreeBSD ) OSMVER=`echo $OSVERS | awk -F. '{print $1}'`
- ;;
- HP-UX ) OSTYPE=HPUX
---- 55,59 ----
- Linux ) OSMVER=`echo $OSVERS | awk -F. '{printf("%d_%d", $1, $2)}'`
- ;;
-! SunOS | IRIX | FreeBSD | NetBSD ) OSMVER=`echo $OSVERS | awk -F. '{print $1}'`
- ;;
- HP-UX ) OSTYPE=HPUX
-***************
-*** 69,74 ****
- echo "OSMVER=$OSMVER"
-
- # Create a directory for the .o files, if it doesn't exist...
-! if [ ! -d objs/${USER:=`whoami`}/${OSTYPE}_${OSVERS} ]; then
- echo "Creating object directory objs/${USER}/${OSTYPE}_${OSVERS}..."
- mkdir bin/${USER}
---- 69,76 ----
- echo "OSMVER=$OSMVER"
-
-+ USER=${USER:=`whoami`}
-+
- # Create a directory for the .o files, if it doesn't exist...
-! if [ ! -d objs/${USER}/${OSTYPE}_${OSVERS} ]; then
- echo "Creating object directory objs/${USER}/${OSTYPE}_${OSVERS}..."
- mkdir bin/${USER}
-***************
-*** 80,84 ****
- fi
-
-! cmd="${MAKE:=make} OSTYPE=$OSTYPE OSMVER=$OSMVER OSVERS=$OSVERS USER=`whoami`"
- case $1 in
- rat ) echo "Running: $cmd bin/${USER}/rat-${OSTYPE}-${OSVERS}"
---- 82,86 ----
- fi
-
-! cmd="${MAKE:=make} OSTYPE=$OSTYPE OSMVER=$OSMVER OSVERS=$OSVERS USER=$USER"
- case $1 in
- rat ) echo "Running: $cmd bin/${USER}/rat-${OSTYPE}-${OSVERS}"
+$NetBSD: patch-ad,v 1.2 1998/11/05 02:46:09 mycroft Exp $
+
+--- Build.orig Sat Aug 15 15:16:43 1998
++++ Build Wed Nov 4 21:34:06 1998
+@@ -54,7 +54,7 @@
+ case $OSTYPE in
+ Linux ) OSMVER=`echo $OSVERS | awk -F. '{printf("%d_%d", $1, $2)}'`
+ ;;
+- SunOS | IRIX | FreeBSD ) OSMVER=`echo $OSVERS | awk -F. '{print $1}'`
++ SunOS | IRIX | FreeBSD | NetBSD ) OSMVER=`echo $OSVERS | awk -F. '{print $1}'`
+ ;;
+ HP-UX ) OSTYPE=HPUX
+ OSMVER=`echo $OSVERS | awk -F. '{print $2}'`
+@@ -68,18 +68,20 @@
+ echo "OSVERS=$OSVERS"
+ echo "OSMVER=$OSMVER"
+
++USER=${USER:=`whoami`}
++
+ # Create a directory for the .o files, if it doesn't exist...
+-if [ ! -d objs/${USER:=`whoami`}/${OSTYPE}_${OSVERS} ]; then
++if [ ! -d objs/${USER}/${OSTYPE}_${OSVERS} ]; then
+ echo "Creating object directory objs/${USER}/${OSTYPE}_${OSVERS}..."
+- mkdir bin/${USER}
+- mkdir objs/${USER}
+- mkdir objs/${USER}/${OSTYPE}_${OSVERS}
++ mkdir -p bin/${USER}
++ mkdir -p objs/${USER}
++ mkdir -p objs/${USER}/${OSTYPE}_${OSVERS}
+ chmod 775 bin/${USER}
+ chmod 775 objs/${USER}
+ chmod 775 objs/${USER}/${OSTYPE}_${OSVERS}
+ fi
+
+-cmd="${MAKE:=make} OSTYPE=$OSTYPE OSMVER=$OSMVER OSVERS=$OSVERS USER=`whoami`"
++cmd="${MAKE:=make} OSTYPE=$OSTYPE OSMVER=$OSMVER OSVERS=$OSVERS USER=$USER"
+ case $1 in
+ rat ) echo "Running: $cmd bin/${USER}/rat-${OSTYPE}-${OSVERS}"
+ eval $cmd bin/${USER}/rat-${OSTYPE}-${OSVERS}
diff --git a/mbone/rat/patches/patch-ae b/mbone/rat/patches/patch-ae
index 5ffa3e4ca91..846740d3316 100644
--- a/mbone/rat/patches/patch-ae
+++ b/mbone/rat/patches/patch-ae
@@ -1,6 +1,7 @@
-$NetBSD: patch-ae,v 1.1 1998/09/13 17:06:09 garbled Exp $
---- Makefile.orig Thu Mar 19 08:40:07 1998
-+++ Makefile Sun Sep 13 09:29:54 1998
+$NetBSD: patch-ae,v 1.2 1998/11/05 02:46:09 mycroft Exp $
+
+--- Makefile.orig Sat Aug 15 15:16:44 1998
++++ Makefile Wed Nov 4 21:27:03 1998
@@ -9,10 +9,10 @@
# -DNDEBUG -DDEBUG -DTEST -DGSM -DDEBUG_MIX -DDEBUG_MEM
# -DDEBUG_RTP -DREPEAT
diff --git a/mbone/rat/patches/patch-af b/mbone/rat/patches/patch-af
index b8dfe4a7a48..fb6032db1b7 100644
--- a/mbone/rat/patches/patch-af
+++ b/mbone/rat/patches/patch-af
@@ -1,16 +1,13 @@
-$NetBSD: patch-af,v 1.1 1998/09/13 17:06:10 garbled Exp $
-*** src/bat_include.h~ Tue May 27 06:27:48 1997
---- src/bat_include.h Thu Mar 5 16:22:59 1998
-***************
-*** 71,75 ****
- #include <arpa/inet.h>
- extern int h_errno;
-! #if !defined(HPUX) && !defined(Linux) && !defined(__FreeBSD__)
- #include <stropts.h>
- #include <sys/filio.h>
---- 71,75 ----
- #include <arpa/inet.h>
- extern int h_errno;
-! #if !defined(HPUX) && !defined(Linux) && !defined(__FreeBSD__) && !defined(__NetBSD__)
- #include <stropts.h>
- #include <sys/filio.h>
+$NetBSD: patch-af,v 1.2 1998/11/05 02:46:09 mycroft Exp $
+
+--- src/bat_include.h.orig Sat Aug 15 15:16:47 1998
++++ src/bat_include.h Wed Nov 4 21:27:03 1998
+@@ -70,7 +70,7 @@
+ #include <netdb.h>
+ #include <arpa/inet.h>
+ extern int h_errno;
+-#if !defined(HPUX) && !defined(Linux) && !defined(__FreeBSD__)
++#if !defined(HPUX) && !defined(Linux) && !defined(__FreeBSD__) && !defined(__NetBSD__)
+ #include <stropts.h>
+ #include <sys/filio.h>
+ #endif /* HPUX */
diff --git a/mbone/rat/patches/patch-ag b/mbone/rat/patches/patch-ag
index 667a0959118..a193fe70ca9 100644
--- a/mbone/rat/patches/patch-ag
+++ b/mbone/rat/patches/patch-ag
@@ -1,21 +1,22 @@
-$NetBSD: patch-ag,v 1.1 1998/09/13 17:06:10 garbled Exp $
-*** src/config.h~ Fri May 23 08:44:14 1997
---- src/config.h Thu Mar 5 16:39:40 1998
-***************
-*** 57,60 ****
---- 57,71 ----
- #endif /* FreeBSD */
-
-+ #ifdef __NetBSD__
-+ #define OSNAME "NetBSD"
-+ #define DEFINED_ERRLIST
-+ #include <sys/stat.h>
-+ #include <sys/time.h>
-+ #include <errno.h>
-+ #include <fcntl.h>
-+ #include <unistd.h>
-+ #include <sys/audioio.h>
-+ #endif
-+
- #ifdef SunOS_5
- #define OSNAME "Solaris"
+$NetBSD: patch-ag,v 1.2 1998/11/05 02:46:09 mycroft Exp $
+
+--- src/config.h.orig Sat Aug 15 15:16:46 1998
++++ src/config.h Wed Nov 4 21:27:03 1998
+@@ -56,6 +56,17 @@
+ #define AUDIO_LINE_IN 2
+ #endif /* FreeBSD */
+
++#ifdef __NetBSD__
++#define OSNAME "NetBSD"
++#define DEFINED_ERRLIST
++#include <sys/stat.h>
++#include <sys/time.h>
++#include <errno.h>
++#include <fcntl.h>
++#include <unistd.h>
++#include <sys/audioio.h>
++#endif
++
+ #ifdef SunOS_5
+ #define OSNAME "Solaris"
+ #include <sys/stat.h>
diff --git a/mbone/rat/patches/patch-ah b/mbone/rat/patches/patch-ah
index b849855f327..bd4085431e6 100644
--- a/mbone/rat/patches/patch-ah
+++ b/mbone/rat/patches/patch-ah
@@ -1,6 +1,7 @@
-$NetBSD: patch-ah,v 1.1 1998/09/13 17:06:10 garbled Exp $
---- /dev/null Sun Sep 13 09:01:39 1998
-+++ Makefile_NetBSD_1 Sun Sep 13 09:32:37 1998
+$NetBSD: patch-ah,v 1.2 1998/11/05 02:46:09 mycroft Exp $
+
+--- /dev/null Wed Nov 4 21:26:51 1998
++++ Makefile_NetBSD_1 Wed Nov 4 21:27:04 1998
@@ -0,0 +1,7 @@
+INCS = -I${X11BASE}/include \
+ -I${LOCALBASE}/include/tcl8.0 \