OSDN Git Service

OpenBSD support patch by (Jacob Meuser // jakemsr jakemsr com)
authorJacob Meuser <jakemsr@jakemsr.com>
Mon, 9 May 2005 13:24:23 +0000 (13:24 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 9 May 2005 13:24:23 +0000 (13:24 +0000)
Originally committed as revision 4208 to svn://svn.ffmpeg.org/ffmpeg/trunk

configure
libavformat/audio.c

index 2484496..1318b11 100755 (executable)
--- a/configure
+++ b/configure
@@ -263,6 +263,15 @@ case `uname -r` in
 ;;
 esac
 ;;
+OpenBSD)
+v4l="no"
+audio_oss="yes"
+dv1394="no"
+make="gmake"
+CFLAGS="$CFLAGS \$(PIC)"
+LDFLAGS="$LDFLAGS -export-dynamic -pthread"
+extralibs="$extralibs -lossaudio"
+;;
 FreeBSD)
 v4l="no"
 audio_oss="yes"
@@ -1295,7 +1304,7 @@ if test "$pthreads" = "yes" ; then
   echo "HAVE_PTHREADS=yes" >> config.mak
   echo "#define HAVE_PTHREADS 1" >> $TMPH
   echo "#define HAVE_THREADS 1" >> $TMPH
-  if test $targetos != FreeBSD; then
+  if test $targetos != FreeBSD -a $targetos != OpenBSD ; then
      extralibs="$extralibs -lpthread"
   fi
 fi
index b03169a..ec7e436 100644 (file)
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#ifdef __OpenBSD__
+#include <soundcard.h>
+#else
 #include <sys/soundcard.h>
+#endif
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
@@ -49,7 +53,11 @@ static int audio_open(AudioData *s, int is_output, const char *audio_device)
 
     /* open linux audio device */
     if (!audio_device)
+#ifdef __OpenBSD__
+       audio_device = "/dev/sound";
+#else
         audio_device = "/dev/dsp";
+#endif
 
     if (is_output)
         audio_fd = open(audio_device, O_WRONLY);