openbsd-ports/mbone/rat/patches/patch-src_auddev_sparc_c
wilfried 106f413f49 * respect CC/CFLAGS
* split patches into separate files
2001-03-17 17:21:41 +00:00

44 lines
1.2 KiB
Plaintext

$OpenBSD: patch-src_auddev_sparc_c,v 1.1 2001/03/17 17:23:27 wilfried Exp $
--- src/auddev_sparc.c.orig Mon Mar 1 18:23:49 1999
+++ src/auddev_sparc.c Fri Mar 16 20:49:24 2001
@@ -45,11 +45,19 @@
#include "assert.h"
#include "bat_include.h"
-#ifdef SunOS
+#if defined(SunOS) || defined(__OpenBSD__)
+#if defined(SunOS)
#include <multimedia/audio_hdr.h>
+#else
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/audioio.h>
+#endif
+#if !defined(__OpenBSD__)
typedef Audio_hdr* audio_header_pointer;
+#endif
static audio_info_t dev_info;
static int mulaw_device = FALSE; /* TRUE if the hardware can only do 8bit mulaw sampling */
@@ -69,7 +77,9 @@ audio_open(audio_format format)
if (audio_fd > 0) {
AUDIO_INITINFO(&dev_info);
dev_info.monitor_gain = 0;
+#if !defined(__OpenBSD__)
dev_info.output_muted = 0; /* 0==not muted */
+#endif
dev_info.play.sample_rate = format.sample_rate;
dev_info.record.sample_rate = format.sample_rate;
dev_info.play.channels = format.num_channels;
@@ -157,7 +167,7 @@ audio_close(int audio_fd)
void
audio_drain(int audio_fd)
{
- ioctl(audio_fd, I_FLUSH, (caddr_t)FLUSHR);
+ ioctl(audio_fd, AUDIO_FLUSH, NULL);
}
/* Gain and volume values are in the range 0 - MAX_AMP */