2009-04-26 13:18:42 -04:00
|
|
|
$OpenBSD: patch-programs_sndfile-play_c,v 1.1 2009/04/26 17:18:42 jasper Exp $
|
|
|
|
--- programs/sndfile-play.c.orig Wed Apr 22 13:56:05 2009
|
|
|
|
+++ programs/sndfile-play.c Wed Apr 22 14:00:49 2009
|
|
|
|
@@ -57,7 +57,7 @@
|
2002-11-19 20:15:50 -05:00
|
|
|
#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>
|
2009-04-26 13:18:42 -04:00
|
|
|
@@ -823,7 +823,7 @@ win32_play (int argc, char *argv [])
|
2002-11-19 20:15:50 -05:00
|
|
|
** 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 [])
|
2009-04-26 13:18:42 -04:00
|
|
|
@@ -860,9 +860,10 @@ solaris_play (int argc, char *argv [])
|
2002-11-19 20:15:50 -05:00
|
|
|
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 ;
|
2009-04-26 13:18:42 -04:00
|
|
|
-
|
2002-11-19 20:15:50 -05:00
|
|
|
+#endif
|
|
|
|
if ((error = ioctl (audio_fd, AUDIO_SETINFO, &audio_info)))
|
|
|
|
{ perror ("ioctl (AUDIO_SETINFO) failed") ;
|
2009-04-26 13:18:42 -04:00
|
|
|
return ;
|
|
|
|
@@ -939,7 +940,7 @@ main (int argc, char *argv [])
|
2005-05-23 19:49:27 -04:00
|
|
|
linux_play (argc, argv) ;
|
2002-11-19 20:15:50 -05:00
|
|
|
#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) ;
|
2005-05-23 19:49:27 -04:00
|
|
|
#elif (OS_IS_WIN32 == 1)
|
2002-11-19 20:15:50 -05:00
|
|
|
win32_play (argc, argv) ;
|