OpenBSD support patch by (Jacob Meuser // jakemsr jakemsr com)

Originally committed as revision 4208 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Jacob Meuser 20 years ago committed by Michael Niedermayer
parent 01cf54f041
commit 8c802695b9
  1. 11
      configure
  2. 8
      libavformat/audio.c

11
configure vendored

@ -263,6 +263,15 @@ case `uname -r` in
;; ;;
esac esac
;; ;;
OpenBSD)
v4l="no"
audio_oss="yes"
dv1394="no"
make="gmake"
CFLAGS="$CFLAGS \$(PIC)"
LDFLAGS="$LDFLAGS -export-dynamic -pthread"
extralibs="$extralibs -lossaudio"
;;
FreeBSD) FreeBSD)
v4l="no" v4l="no"
audio_oss="yes" audio_oss="yes"
@ -1295,7 +1304,7 @@ if test "$pthreads" = "yes" ; then
echo "HAVE_PTHREADS=yes" >> config.mak echo "HAVE_PTHREADS=yes" >> config.mak
echo "#define HAVE_PTHREADS 1" >> $TMPH echo "#define HAVE_PTHREADS 1" >> $TMPH
echo "#define HAVE_THREADS 1" >> $TMPH echo "#define HAVE_THREADS 1" >> $TMPH
if test $targetos != FreeBSD; then if test $targetos != FreeBSD -a $targetos != OpenBSD ; then
extralibs="$extralibs -lpthread" extralibs="$extralibs -lpthread"
fi fi
fi fi

@ -21,7 +21,11 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __OpenBSD__
#include <soundcard.h>
#else
#include <sys/soundcard.h> #include <sys/soundcard.h>
#endif
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/ioctl.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 */ /* open linux audio device */
if (!audio_device) if (!audio_device)
#ifdef __OpenBSD__
audio_device = "/dev/sound";
#else
audio_device = "/dev/dsp"; audio_device = "/dev/dsp";
#endif
if (is_output) if (is_output)
audio_fd = open(audio_device, O_WRONLY); audio_fd = open(audio_device, O_WRONLY);

Loading…
Cancel
Save