openbsd-ports/audio/libsndfile/patches/patch-examples_sndfile-play_c

42 lines
1.5 KiB
Plaintext
Raw Normal View History

$OpenBSD: patch-examples_sndfile-play_c,v 1.2 2005/05/23 23:49:28 naddy Exp $
--- examples/sndfile-play.c.orig Sun Nov 14 20:57:17 2004
+++ examples/sndfile-play.c Mon May 23 22:43:53 2005
@@ -43,7 +43,7 @@
#include <Carbon.h>
#include <CoreAudio/AudioHardware.h>
-#elif (defined (sun) && defined (unix))
+#elif (defined (__OpenBSD__) || (defined (sun) && defined (unix)))
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/audioio.h>
@@ -798,7 +798,7 @@ win32_play (int argc, char *argv [])
** Solaris.
*/
-#if (defined (sun) && defined (unix)) /* ie Solaris */
+#if (defined (__OpenBSD__) || (defined (sun) && defined (unix))) /* ie Solaris */
static void
solaris_play (int argc, char *argv [])
@@ -835,8 +835,10 @@ solaris_play (int argc, char *argv [])
audio_info.play.channels = sfinfo.channels ;
audio_info.play.precision = 16 ;
audio_info.play.encoding = AUDIO_ENCODING_LINEAR ;
+#if !defined(__OpenBSD__)
audio_info.play.gain = AUDIO_MAX_GAIN ;
audio_info.play.balance = AUDIO_MID_BALANCE ;
+#endif
if ((error = ioctl (audio_fd, AUDIO_SETINFO, &audio_info)))
{ perror ("ioctl (AUDIO_SETINFO) failed") ;
@@ -914,7 +916,7 @@ main (int argc, char *argv [])
linux_play (argc, argv) ;
#elif (defined (__MACH__) && defined (__APPLE__))
macosx_play (argc, argv) ;
-#elif (defined (sun) && defined (unix))
+#elif (defined (__OpenBSD__) || (defined (sun) && defined (unix)))
solaris_play (argc, argv) ;
#elif (OS_IS_WIN32 == 1)
win32_play (argc, argv) ;