openbsd-ports/audio/libsndfile/patches/patch-programs_sndfile-play_c
jasper de46124b17 - update libsndfile to 1.0.19
* includes a SECURITY FIX for CVE-2009-0186
- specify license version
- bump major

ok naddy@ (MAINTAINER)
2009-04-26 17:18:42 +00:00

43 lines
1.5 KiB
Plaintext
Executable File

$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 @@
#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>
@@ -823,7 +823,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 [])
@@ -860,9 +860,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") ;
return ;
@@ -939,7 +940,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) ;