$NetBSD: patch-ad,v 1.2 2002/09/26 12:29:56 jlam Exp $ --- wavplay.c.orig Tue Jul 17 12:39:14 2001 +++ wavplay.c @@ -14,6 +14,14 @@ #include #include #include +#ifdef __NetBSD__ +#include +# ifdef HAVE_OSS +# include +# else +# include +# endif +#endif #if defined(linux) || defined(__CYGWIN32__) #include #endif @@ -22,7 +30,7 @@ #include #include #endif -#ifdef sun +#if defined(sun) || (defined(__NetBSD__) && !defined(HAVE_OSS)) #include #endif #ifdef hpux @@ -48,8 +56,8 @@ guchar waveHdr[44]; gint abuf_size; gchar *audiobuf; -#if defined(linux) || defined(__FreeBSD__) -#define DEFAULT_AUDIO_DEVICE "/dev/dsp" +#if defined(linux) || defined(__FreeBSD__) || (defined(__NetBSD__) && defined(HAVE_OSS)) +#define DEFAULT_AUDIO_DEVICE "@DEVOSSAUDIO@" #elif defined (aix) #define DEFAULT_AUDIO_DEVICE "" #else @@ -59,7 +67,7 @@ gchar *audiobuf; #define DEFAULT_BUFFER_SIZE 32768 -#if defined(linux) || defined(__FreeBSD__) +#if defined(linux) || defined(__FreeBSD__) || (defined(__NetBSD__) && defined(HAVE_OSS)) /* open the sound-device of linux and set cd-quality */ @@ -110,7 +118,7 @@ gint flags; #endif -#ifdef sun +#if defined(sun) || (defined(__NetBSD__) && !defined(HAVE_OSS)) /* open the sound-device of solaris and set cd-quality */ @@ -137,7 +145,9 @@ gint flags; info.play.precision = 16; info.play.encoding = AUDIO_ENCODING_LINEAR; info.play.buffer_size = abuf_size; +#ifndef __NetBSD__ info.output_muted = 0; +#endif if (ioctl(audio, AUDIO_SETINFO, &info) == -1) { g_warning("Unable to set audio parameters\n"); @@ -332,10 +342,10 @@ gchar tmpswap; } /* this sets also the global abuf_size-variable */ -#if defined(linux) || defined(__FreeBSD__) +#if defined(linux) || defined(__FreeBSD__) || (defined(__NetBSD__) && defined(HAVE_OSS)) audio = open_linux_audio(audio_dev); #endif -#ifdef sun +#if defined(sun) || (defined(__NetBSD__) && !defined(HAVE_OSS)) audio = open_solaris_audio(audio_dev); #endif #ifdef hpux