« Return to Thread: mplayer update effort

mplayer update effort

by Edd Barrett :: Rate this Message:

Reply to Author | View in Thread

Hello,

Our in tree version of MPlayer is ancient. I noticed this when trying
smplayer last week and it told me so. I CC'd the maintainer of mplayer
in and I have not heard anything, so I attempted to take an update on
myself.

I was hoping someone could help me out here, as I am getting assembler
errors, which I do not have enough knowledge to debug. It seems I
only get these when using external versions of various libraries, as
bulding mplayer standalone works fine (I built one in /opt).

Does anyone know how to start debugging this:

cc -Wundef -Wdisabled-optimization -std=gnu99 -O2 -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -Ilibdvdread4 -I. -I/usr/local/include -D_THREAD_SAFE -I/usr/X11R6/include -I/usr/X11R6/include/freetype2 -I/usr/X11R6/ include -I/usr/local/include/gtk-2.0 -I/usr/local/lib/gtk-2.0/include -I/usr/local/include/pango-1.0 -I/usr/X11R6/include -I/usr/local/include/atk-1.0 -I/usr/local/include/cairo -I/usr/X11R6/include/pixman-1 -I/usr/local/include -I/usr/local/include/libpng -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/X11R6/include/freetype2   -c -o liba52/resample.o liba52/resample.c
{standard input}: Assembler messages:
{standard input}:884: Error: junk `C magicF2W' after expression
{standard input}:885: Error: junk `C wm1100' after expression
{standard input}:886: Error: junk `C wm0101' after expression
{standard input}:887: Error: junk `C wm1010' after expression
{standard input}:931: Error: junk `C magicF2W' after expression
{standard input}:971: Error: junk `C magicF2W' after expression
{standard input}:1034: Error: junk `C magicF2W' after expression
{standard input}:1095: Error: junk `C magicF2W' after expression
{standard input}:1163: Error: junk `C magicF2W' after expression
{standard input}:1214: Error: junk `C magicF2W' after expression
{standard input}:1261: Error: junk `C magicF2W' after expression
{standard input}:1310: Error: junk `C magicF2W' after expression
{standard input}:1364: Error: junk `C magicF2W' after expression
gmake: *** [liba52/resample.o] Error 1
*** Error code 2

I am attaching what I have. It would be great if someone
could kinda "team up" with me to try and roll out a newer mplayer
version.

The attached diff is *far* from finished. For a start the sndio stuff
needs to be fitted properly. I have not gotten round to that yet
and the man page needs tweaking etc. etc.

Thanks

--

Best Regards

Edd Barrett
(Freelance software developer / technical writer / open-source developer)

http://students.dec.bmth.ac.uk/ebarrett

diff -urNa mplayer/Makefile mplayer.new/Makefile
--- mplayer/Makefile Thu Jul  9 16:12:47 2009
+++ mplayer.new/Makefile Thu Jul  9 16:13:26 2009
@@ -5,14 +5,16 @@
 
 COMMENT= movie player supporting MPEG, DivX, AVI, ASF, MOV & more
 
-V= 1.0rc2
+V= 20090708
 N= mplayer
-DISTNAME= MPlayer-${V}
-DIST_SUBDIR= ${N}
-PKGNAME= ${N}-${V}p24
+DISTNAME= mplayer-export-snapshot-${V}
+#DIST_SUBDIR= mplayer-export-2009-07-08
+PKGNAME= ${N}-${V}
 CATEGORIES= x11 multimedia
 EXTRACT_SUFX= .tar.bz2
 
+WRKDIST = ${WRKDIR}/mplayer-export-2009-07-08
+
 HOMEPAGE= http://www.mplayerhq.hu/
 
 # GPL
@@ -22,19 +24,19 @@
 PERMIT_DISTFILES_FTP= Yes
 WANTLIB= c m ncurses pthread stdc++ util sndio z
 
-MASTER_SITES= http://www1.mplayerhq.hu/MPlayer/releases/ \
- http://www2.mplayerhq.hu/MPlayer/releases/ \
- http://www.mplayerhq.hu/MPlayer/releases/ \
- http://ftp.lug.udel.edu/MPlayer/releases/
-
+# XXX will need to host myself
+MASTER_SITES = http://students.dec.bmth.ac.uk/ebarrett/distfiles/
+
 # The skins tarball changes on a daily basis so it is mirrored
 # locally, do NOT change this.
+# XXX is this still so? The infrastructure at their end changed.
 #MASTER_SITES0= http://www2.mplayerhq.hu/MPlayer/Skin/
-MASTER_SITES0= ${MASTER_SITE_BACKUP}
+MASTER_SITES0 = http://www.mplayerhq.hu/MPlayer/skins/
+#MASTER_SITES0= ${MASTER_SITE_BACKUP}
 
 MAINTAINER=     Bjorn Sandell <biorn@...>
 
-SKIN= default
+SKIN= Blue
 SKINVER= 1.7
 DISTFILES= ${DISTNAME}${EXTRACT_SUFX} ${SKIN}-${SKINVER}${EXTRACT_SUFX}:0
 
@@ -69,22 +71,15 @@
  --disable-nas \
  --disable-liblzo \
  --disable-caca \
- --disable-vidix-internal \
- --disable-vidix-external \
  --enable-libdv \
  --disable-smb \
- --disable-tremor-external \
- --enable-tremor-internal \
  --disable-faac \
  --disable-select \
  --enable-theora \
  --enable-menu \
  --enable-iconv \
  --enable-cdparanoia \
- --enable-x264 \
  --enable-tv-v4l2 \
- --with-extraincdir=${LOCALBASE}/include/libpng:${LOCALBASE}/include \
- --with-extralibdir=${LOCALBASE}/lib \
  --extra-libs-mplayer="$$(pkg-config --libs x264)" \
  --extra-libs-mencoder="$$(pkg-config --libs x264)" \
  --confdir=${CONFDIR} \
@@ -92,10 +87,11 @@
  --disable-langinfo \
  --disable-fribidi \
  --disable-openal \
- --disable-faad-internal \
- --enable-faad-external \
  --disable-libvorbis \
- --disable-libcdio
+ --disable-libcdio \
+ --extra-cflags=-I${LOCALBASE}/include \
+ --extra-ldflags=-L${LOCALBASE}/lib \
+ --enable-x264
 
 CONFIGURE_ENV+= TMPDIR="${WRKBUILD}"
 
diff -urNa mplayer/distinfo mplayer.new/distinfo
--- mplayer/distinfo Wed Jul  8 20:14:05 2009
+++ mplayer.new/distinfo Wed Jul  8 19:15:06 2009
@@ -1,10 +1,10 @@
-MD5 (mplayer/MPlayer-1.0rc2.tar.bz2) = fiflNcLSZ2N980iY8bkXBw==
-MD5 (mplayer/default-1.7.tar.bz2) = fh0WwvijJGn0NUywQ+7MXQ==
-RMD160 (mplayer/MPlayer-1.0rc2.tar.bz2) = O1y6FSmFahd6UZHiL43MALWoPFI=
-RMD160 (mplayer/default-1.7.tar.bz2) = X3j/nbKW2P1T72YD7IoifutgLdE=
-SHA1 (mplayer/MPlayer-1.0rc2.tar.bz2) = 6bSW81J8VSAE7G0B1rQ/GWtDzi0=
-SHA1 (mplayer/default-1.7.tar.bz2) = aRLD5YtMdvrZf9tylFsngVBp9+M=
-SHA256 (mplayer/MPlayer-1.0rc2.tar.bz2) = OHW3zIXo59+BwCpjjba0qXDR5mqG2tbr8podGfOPWVM=
-SHA256 (mplayer/default-1.7.tar.bz2) = qZkLpTTMqUwad0dF2eMUiRn3kAOmgz/8x4N3HM3gulM=
-SIZE (mplayer/MPlayer-1.0rc2.tar.bz2) = 9338201
-SIZE (mplayer/default-1.7.tar.bz2) = 173439
+MD5 (Blue-1.7.tar.bz2) = 5OICDRG2garImBA7O6cjxA==
+MD5 (mplayer-export-snapshot-20090708.tar.bz2) = XYBaG3E4g3fdMu6vTNW+4g==
+RMD160 (Blue-1.7.tar.bz2) = H4xTnMrcVO6l5meIObzIrh4W5us=
+RMD160 (mplayer-export-snapshot-20090708.tar.bz2) = KWTgoDLjhsjTs4w9Qkm310WVDh4=
+SHA1 (Blue-1.7.tar.bz2) = ReXuelVBpfHP0meKbJtZEcpHPLk=
+SHA1 (mplayer-export-snapshot-20090708.tar.bz2) = /XGBmgcrR2zj4vYTTMU26N5wk8k=
+SHA256 (Blue-1.7.tar.bz2) = i805pXVcRN93jryjEZySI0er/a2xAdzvARziVmwfsdg=
+SHA256 (mplayer-export-snapshot-20090708.tar.bz2) = CFtDchdvXwXt/4pQo7f6KpWXEIw6ghz5+e4Z//isIVE=
+SIZE (Blue-1.7.tar.bz2) = 222567
+SIZE (mplayer-export-snapshot-20090708.tar.bz2) = 8238626
diff -urNa mplayer/patches/patch-DOCS_man_en_mplayer_1 mplayer.new/patches/patch-DOCS_man_en_mplayer_1
--- mplayer/patches/patch-DOCS_man_en_mplayer_1 Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-DOCS_man_en_mplayer_1 Thu Jan  1 01:00:00 1970
@@ -1,30 +0,0 @@
-$OpenBSD: patch-DOCS_man_en_mplayer_1,v 1.1 2009/02/08 20:25:09 naddy Exp $
---- DOCS/man/en/mplayer.1.orig Sun Feb  8 19:50:39 2009
-+++ DOCS/man/en/mplayer.1 Sun Feb  8 19:51:38 2009
-@@ -1177,7 +1177,7 @@ May be negative.
- .
- .TP
- .B \-cdrom-device <path to device>
--Specify the CD-ROM device (default: /dev/\:cdrom).
-+Specify the CD-ROM device (default: /dev/rcd0c).
- .
- .TP
- .B \-channels <number> (also see \-af channels)
-@@ -1300,7 +1300,7 @@ frequency before giving up (default: 30).
- .
- .TP
- .B \-dvd-device <path to device> (DVD only)
--Specify the DVD device (default: /dev/\:dvd).
-+Specify the DVD device (default: /dev/rcd0c).
- You can also specify a directory that contains files previously copied directly
- from a DVD (with e.g.\& vobcopy).
- Note that using \-dumpstream is usually a better way to
-@@ -10519,7 +10519,7 @@ mplayer dvd://1 \-dvdangle 2
- .PP
- .B Play from a different DVD device:
- .nf
--mplayer dvd://1 \-dvd-device /dev/\:dvd2
-+mplayer dvd://1 \-dvd-device /dev/rcd1c
- .fi
- .
- .PP
diff -urNa mplayer/patches/patch-Makefile mplayer.new/patches/patch-Makefile
--- mplayer/patches/patch-Makefile Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-Makefile Thu Jan  1 01:00:00 1970
@@ -1,12 +0,0 @@
-$OpenBSD: patch-Makefile,v 1.18 2008/07/09 02:19:36 jakemsr Exp $
---- Makefile.orig Sun Oct  7 12:49:33 2007
-+++ Makefile Sat Jun 28 14:12:25 2008
-@@ -88,7 +88,7 @@ ALL_PRG-$(MPLAYER)  += mplayer$(EXESUF)
- ALL_PRG-$(MENCODER) += mencoder$(EXESUF)
-
- COMMON_LIBS  += $(COMMON_LIBS-yes)
--LIBS_MPLAYER += $(LIBS_MPLAYER-yes)
-+LIBS_MPLAYER += $(LIBS_MPLAYER-yes) -lrtunes -lcrypto
- OBJS_MPLAYER += $(OBJS_MPLAYER-yes)
- PARTS        += $(PARTS-yes)
- ALL_PRG      += $(ALL_PRG-yes)
diff -urNa mplayer/patches/patch-common_mak mplayer.new/patches/patch-common_mak
--- mplayer/patches/patch-common_mak Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-common_mak Thu Jan  1 01:00:00 1970
@@ -1,23 +0,0 @@
-$OpenBSD: patch-common_mak,v 1.2 2008/07/09 02:19:36 jakemsr Exp $
---- common.mak.orig Sun Oct  7 12:49:33 2007
-+++ common.mak Sat Jun 28 14:11:44 2008
-@@ -10,9 +10,17 @@ OBJS     += $(OBJS-yes)
- ASM_OBJS += $(ASM_OBJS-yes)
- CPP_OBJS += $(CPP_OBJS-yes)
-
--CFLAGS += -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
-+CFLAGS := -DHAVE_AV_CONFIG_H \
-           -D_ISOC9X_SOURCE -I$(BUILD_ROOT) -I$(SRC_PATH) \
--          -I$(SRC_PATH)/libavutil $(OPTFLAGS)
-+          -I$(SRC_PATH)/libavutil $(CFLAGS)
-+
-+ifeq ($(ARCH_X86),yes)
-+CFLAGS += -fomit-frame-pointer
-+endif
-+
-+#CFLAGS := $(subst -O3,-O,$(CFLAGS))
-+#CFLAGS := $(subst -O2,-O,$(CFLAGS))
-+#CFLAGS := $(subst -O1,-O,$(CFLAGS))
-
- SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S) $(CPPOBJS:.o=.cpp)
- OBJS := $(OBJS) $(ASM_OBJS) $(CPPOBJS)
diff -urNa mplayer/patches/patch-configure mplayer.new/patches/patch-configure
--- mplayer/patches/patch-configure Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-configure Wed Jul  8 19:23:17 2009
@@ -1,195 +1,16 @@
-$OpenBSD: patch-configure,v 1.51 2009/05/05 11:40:08 sthen Exp $
---- configure.orig Sun Oct  7 22:49:33 2007
-+++ configure Sun Apr 19 13:55:04 2009
-@@ -76,7 +76,7 @@ cc_check() {
- }
-
- cxx_check() {
--  compile_check $TMPCPP $@ -lstdc++
-+  compile_check $TMPCPP $@ -lstdc++ -lm
- }
-
- tmp_run() {
-@@ -397,6 +397,7 @@ Audio output:
-   --disable-nas          disable NAS audio output [autodetect]
-   --disable-sgiaudio     disable SGI audio output [autodetect]
-   --disable-sunaudio     disable Sun audio output [autodetect]
-+  --disable-libsndio     disable libsndio audio output [autodetect]
-   --disable-win32waveout disable Windows waveout audio output [autodetect]
-   --disable-select       disable using select() on the audio device [enable]
-
-@@ -501,7 +502,7 @@ _libavcodec_a=auto
- _libamr_nb=auto
- _libamr_wb=auto
- _libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
--_libavdecoders=` echo $_libavdecoders_all | sed -e s/LIBFAAD_DECODER// -e s/MPEG4AAC_DECODER//  -e s/LIBA52_DECODER// -e s/LIBGSM_DECODER// -e s/LIBGSM_MS_DECODER// -e s/LIBVORBIS_DECODER// `
-+_libavdecoders=` echo $_libavdecoders_all | sed -e s/LIBFAAD_DECODER// -e s/MPEG4AAC_DECODER//  -e s/LIBA52_DECODER// -e s/LIBGSM_DECODER// -e s/LIBGSM_MS_DECODER// -e s/LIBVORBIS_DECODER// -e s/VORBIS_DECODER// `
- _libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
- _libavencoders=` echo $_libavencoders_all | sed -e s/LIBGSM_ENCODER// -e s/LIBGSM_MS_ENCODER// -e s/LIBTHEORA_ENCODER// `
- _libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
-@@ -598,6 +599,7 @@ _xf86keysym=auto
- _mlib=no #broken, thus disabled
- _sgiaudio=auto
- _sunaudio=auto
-+_libsndio=auto
- _alsa=auto
- _fastmemcpy=yes
- _unrarlib=yes
-@@ -963,6 +965,8 @@ for ac_option do
-   --disable-mlib) _mlib=no ;;
-   --enable-sunaudio) _sunaudio=yes ;;
-   --disable-sunaudio) _sunaudio=no ;;
-+  --enable-libsndio) _libsndio=yes ;;
-+  --disable-libsndio) _libsndio=no ;;
-   --enable-sgiaudio) _sgiaudio=yes ;;
-   --disable-sgiaudio) _sgiaudio=no ;;
-   --enable-alsa) _alsa=yes ;;
-@@ -1557,6 +1561,8 @@ if x86 ; then
-   pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
-                            -e s/xmm/sse/ -e s/kni/sse/`
-
-+  if x86_64 ; then pparam="3dnow 3dnowext mmx mmxext xmm sse sse2" ; fi
-+
-   for ext in $pparam ; do
-     eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
-   done
-@@ -2323,7 +2329,7 @@ fi # if darwin && test "$cc_vendor" = "gnu" ; then
- # Checking for CFLAGS
- _install_strip="-s"
- if test "$_profile" != "" || test "$_debug" != "" ; then
--  CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
-+  CFLAGS="-W -Wall -O1 $_march $_mcpu $_pipe $_debug $_profile"
-   _install_strip=
- elif test -z "$CFLAGS" ; then
-   if test "$cc_vendor" = "intel" ; then
-@@ -3065,7 +3071,7 @@ int main(void) { pthread_t tid; return pthread_create
+$OpenBSD$
+--- configure.orig Wed Jul  8 19:21:27 2009
++++ configure Wed Jul  8 19:23:12 2009
+@@ -2374,7 +2374,11 @@ cat > $TMPC << EOF
+ int ff_extern;
  EOF
- _pthreads=no
- if not hpux ; then
--  for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
-+  for _ld_tmp in "-lpthreadGC2" "" "-pthread" "-lpthread" ; do
-     # for crosscompilation, we cannot execute the program, be happy if we can link statically
-     cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
-   done
-@@ -3108,7 +3114,7 @@ fi
- echores "$_rpath"
-
- echocheck "iconv"
--if test "$_iconv" = auto ; then
-+if test "$_iconv" != no ; then
-   cat > $TMPC << EOF
- #include <stdio.h>
- #include <unistd.h>
-@@ -4369,6 +4375,8 @@ if test "$_aa" = yes ; then
-   _def_aa='#define HAVE_AA 1'
-   if cygwin ; then
-     _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
-+  else
-+    _libs_mplayer="$_libs_mplayer -laa"
-   fi
-   _vosrc="$_vosrc vo_aa.c"
-   _vomodules="aa $_vomodules"
-@@ -4576,7 +4584,7 @@ fi
- echores "$_png"
- if test "$_png" = yes ; then
-   _def_png='#define HAVE_PNG 1'
--  _ld_extra="$_ld_extra -lpng -lz"
-+  _ld_extra="$_ld_extra -lpng -lz $_ld_lm"
-   _vosrc="$_vosrc vo_png.c"
-   _vomodules="png $_vomodules"
- else
-@@ -5129,7 +5137,8 @@ fi
- echocheck "JACK"
- if test "$_jack" = auto ; then
-   _jack=yes
--
-+fi
-+if test "$_jack" = yes ; then
- cat > $TMPC << EOF
- #include <jack/jack.h>
- int main(void) { jack_client_new("test"); return 0; }
-@@ -5303,6 +5312,27 @@ fi
- echores "$_sunaudio"
-
-
-+echocheck "libsndio audio"
-+if test "$_libsndio" = auto ; then
-+  cat > $TMPC << EOF
-+#include <sndio.h>
-+int main(void) { struct sio_par par; sio_initpar(&par); return 0; }
-+EOF
-+  _libsndio=no
-+  cc_check -lsndio && _libsndio=yes
-+fi
-+if test "$_libsndio" = yes ; then
-+  _def_libsndio='#define USE_LIBSNDIO_AUDIO 1'
-+  _aosrc="$_aosrc ao_libsndio.c"
-+  _aomodules="libsndio $_aomodules"
-+  _libs_mplayer="$_libs_mplayer -lsndio"
-+else
-+  _def_libsndio='#undef USE_LIBSNDIO_AUDIO'
-+  _noaomodules="libsndio $_noaomodules"
-+fi
-+echores "$_libsndio"
+ cc_check -c || die "Symbol mangling check failed."
+-sym=$($_nm -P -g $TMPEXE)
 +
++# OpenBSD nm does not understand -P (posix mode on linux)
++# sym=$($_nm -P -g $TMPEXE) */
++sym=$($_nm -g $TMPEXE)
 +
- if sunos; then
- echocheck "Sun mediaLib"
- if test "$_mlib" = auto ; then
-@@ -5343,7 +5373,7 @@ fi #if irix
-
-
- echocheck "VCD support"
--if linux || bsdos || freebsd || netbsd || sunos || darwin || mingw32; then
-+if linux || bsdos || freebsd || netbsd || sunos || darwin || mingw32 || openbsd ; then
-   _inputmodules="vcd $_inputmodules"
-   _def_vcd='#define HAVE_VCD 1'
-   _vcd="yes"
-@@ -5592,7 +5622,7 @@ int main()
- }
- EOF
-   _fontconfig=no
--  for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
-+  for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz $_ld_lm" ; do
-     _ld_tmp="-lfontconfig $_ld_tmp"
-     cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
-   done
-@@ -5704,10 +5734,10 @@ cat > $TMPC << EOF
- int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
- EOF
- _zlib=no
--cc_check -lz && _zlib=yes
-+cc_check "-lz $_ld_lm" && _zlib=yes
- if test "$_zlib" = yes ; then
-   _def_zlib='#define HAVE_ZLIB 1'
--  _ld_extra="$_ld_extra -lz"
-+  _ld_extra="$_ld_extra -lz $_ld_lm"
- else
-   _def_zlib='#undef HAVE_ZLIB'
-   _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
-@@ -6207,7 +6237,7 @@ if test "$_real" = auto ; then
-   _real=no
-   _res_comment="dynamic loader support needed"
-   if test "$_dl" = yes || test "$_win32dll" = yes &&
--     (linux || freebsd || netbsd || win32 || darwin) ; then
-+     (linux || freebsd || netbsd || openbsd || win32 || darwin) ; then
-     _real=yes
-   fi
- fi
-@@ -8151,6 +8181,7 @@ $_def_openal_h
- $_def_sys_asoundlib_h
- $_def_alsa_asoundlib_h
- $_def_sunaudio
-+$_def_libsndio
- $_def_sgiaudio
- $_def_win32waveout
- $_def_nas
-@@ -8240,7 +8271,7 @@ $_def_vcd
- #define DEFAULT_CDROM_DEVICE    "/dev/disk1"
- #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
- #elif defined(__OpenBSD__)
--#define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
-+#define DEFAULT_CDROM_DEVICE "/dev/rcd0c"
- #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
- #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
- #define DEFAULT_CDROM_DEVICE "/dev/acd0"
+ extern_prefix=${sym%%ff_extern*}
+ def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
+ echores $extern_prefix
diff -urNa mplayer/patches/patch-configure.orig mplayer.new/patches/patch-configure.orig
--- mplayer/patches/patch-configure.orig Thu Jan  1 01:00:00 1970
+++ mplayer.new/patches/patch-configure.orig Wed Jul  8 19:22:43 2009
@@ -0,0 +1,16 @@
+$OpenBSD$
+--- configure.orig Wed Jul  8 19:21:27 2009
++++ configure Wed Jul  8 19:22:35 2009
+@@ -2374,7 +2374,11 @@ cat > $TMPC << EOF
+ int ff_extern;
+ EOF
+ cc_check -c || die "Symbol mangling check failed."
+-sym=$($_nm -P -g $TMPEXE)
++
++/* OpenBSD nm does not understand -P (posix mode on linux) */
++/* sym=$($_nm -P -g $TMPEXE) */
++sym=$($_nm -g $TMPEXE)
++
+ extern_prefix=${sym%%ff_extern*}
+ def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
+ echores $extern_prefix
diff -urNa mplayer/patches/patch-configure~ mplayer.new/patches/patch-configure~
--- mplayer/patches/patch-configure~ Thu Jan  1 01:00:00 1970
+++ mplayer.new/patches/patch-configure~ Wed Jul  8 19:23:14 2009
@@ -0,0 +1,16 @@
+$OpenBSD$
+--- configure.orig Wed Jul  8 19:21:27 2009
++++ configure Wed Jul  8 19:23:12 2009
+@@ -2374,7 +2374,11 @@ cat > $TMPC << EOF
+ int ff_extern;
+ EOF
+ cc_check -c || die "Symbol mangling check failed."
+-sym=$($_nm -P -g $TMPEXE)
++
++# OpenBSD nm does not understand -P (posix mode on linux)
++# sym=$($_nm -P -g $TMPEXE) */
++sym=$($_nm -g $TMPEXE)
++
+ extern_prefix=${sym%%ff_extern*}
+ def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
+ echores $extern_prefix
diff -urNa mplayer/patches/patch-dvdread_Makefile mplayer.new/patches/patch-dvdread_Makefile
--- mplayer/patches/patch-dvdread_Makefile Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-dvdread_Makefile Thu Jan  1 01:00:00 1970
@@ -1,14 +0,0 @@
-$OpenBSD: patch-dvdread_Makefile,v 1.1 2008/02/08 17:32:41 jakemsr Exp $
---- dvdread/Makefile.orig Mon Jan 21 15:04:18 2008
-+++ dvdread/Makefile Mon Jan 21 15:04:41 2008
-@@ -12,8 +12,8 @@ SRCS_COMMON = cmd_print.c \
-               nav_print.c \
-               nav_read.c \
-
--CFLAGS = -D__USE_UNIX98 -D_GNU_SOURCE
--
- CFLAGS-$(DVDCSS_INTERNAL) += -I../libdvdcss -DHAVE_DVDCSS_DVDCSS_H
-
- include ../mpcommon.mak
-+
-+CFLAGS += -D__USE_UNIX98 -D_GNU_SOURCE
diff -urNa mplayer/patches/patch-libao2_Makefile mplayer.new/patches/patch-libao2_Makefile
--- mplayer/patches/patch-libao2_Makefile Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libao2_Makefile Thu Jan  1 01:00:00 1970
@@ -1,11 +0,0 @@
-$OpenBSD: patch-libao2_Makefile,v 1.1 2008/02/12 11:33:16 jakemsr Exp $
---- libao2/Makefile.orig Sun Oct  7 12:49:27 2007
-+++ libao2/Makefile Sun Feb 10 17:05:17 2008
-@@ -6,6 +6,7 @@ SRCS_MPLAYER = audio_out.c \
-                ao_mpegpes.c \
-                ao_null.c \
-                ao_pcm.c \
-+               ao_rtunes.c \
-                $(AO_SRCS) \
-
- include ../mpcommon.mak
diff -urNa mplayer/patches/patch-libao2_ao_sun_c mplayer.new/patches/patch-libao2_ao_sun_c
--- mplayer/patches/patch-libao2_ao_sun_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libao2_ao_sun_c Thu Jan  1 01:00:00 1970
@@ -1,139 +0,0 @@
-$OpenBSD: patch-libao2_ao_sun_c,v 1.4 2008/02/08 17:32:41 jakemsr Exp $
---- libao2/ao_sun.c.orig Sun Oct  7 12:49:27 2007
-+++ libao2/ao_sun.c Mon Feb  4 05:07:06 2008
-@@ -102,6 +102,7 @@ static int af2sunfmt(int format)
- // sample counter information
- static int realtime_samplecounter_available(char *dev)
- {
-+#ifdef __svr4__
-     int fd = -1;
-     audio_info_t info;
-     int rtsc_ok = RTSC_DISABLED;
-@@ -217,6 +218,9 @@ error:
-     }
-
-     return rtsc_ok;
-+#else
-+    return RTSC_DISABLED;
-+#endif
- }
-
-
-@@ -440,7 +444,7 @@ static int control(int cmd,void *arg){
- else
-    info.play.balance = (vol->right - vol->left + volume) * AUDIO_RIGHT_BALANCE / (2*volume);
-    }
--#if !defined (__OpenBSD__) && !defined (__NetBSD__)
-+#if !defined (__NetBSD__)
-    info.output_muted = (volume == 0);
- #endif
-    ioctl( fd,AUDIO_SETINFO,&info );
-@@ -566,11 +570,20 @@ static int init(int rate,int channels,int format,int f
-     ao_data.bps = byte_per_sec = bytes_per_sample * ao_data.samplerate;
-     ao_data.outburst = byte_per_sec > 100000 ? 16384 : 8192;
-
-+#if defined(__OpenBSD__) || defined(__NetBSD__)
-     AUDIO_INITINFO(&info);
-+    info.blocksize = ao_data.outburst;
-+    ioctl (audio_fd, AUDIO_SETINFO, &info);
-+#endif
-+#ifdef __svr4__
-+    AUDIO_INITINFO(&info);
-     info.play.samples = 0;
-     info.play.eof = 0;
-     info.play.error = 0;
-     ioctl (audio_fd, AUDIO_SETINFO, &info);
-+#else
-+    ioctl (audio_fd, AUDIO_FLUSH);
-+#endif
-
-     queued_bursts = 0;
-     queued_samples = 0;
-@@ -607,9 +620,11 @@ static void reset(void){
- : AUDIO_PRECISION_8);
-     info.play.channels = ao_data.channels;
-     info.play.sample_rate = ao_data.samplerate;
-+#ifdef __svr4__
-     info.play.samples = 0;
-     info.play.eof = 0;
-     info.play.error = 0;
-+#endif
-     ioctl (audio_fd, AUDIO_SETINFO, &info);
-     queued_bursts = 0;
-     queued_samples = 0;
-@@ -636,7 +651,11 @@ static void audio_resume(void)
-
- // return: how many bytes can be played without blocking
- static int get_space(void){
-+#if defined(__OpenBSD__)
-+    audio_bufinfo_t ab;
-+#else
-     audio_info_t info;
-+#endif
-
-     // check buffer
- #ifdef HAVE_AUDIO_SELECT
-@@ -651,14 +670,22 @@ static int get_space(void){
-     }
- #endif
-
-+#if defined(__OpenBSD__)
-+    ioctl(audio_fd, AUDIO_GETPRINFO, &ab);
-+    if (ab.hiwat * ab.blksize - ab.seek < ao_data.outburst)
-+ return 0;
-+    else
-+ return ao_data.outburst;
-+#else
-     ioctl(audio_fd, AUDIO_GETINFO, &info);
--#if !defined (__OpenBSD__) && !defined(__NetBSD__)
-+#if !defined(__NetBSD__)
-     if (queued_bursts - info.play.eof > 2)
- return 0;
-     return ao_data.outburst;
- #else
-     return info.hiwat * info.blocksize - info.play.seek;
- #endif
-+#endif  // __OpenBSD__
-
- }
-
-@@ -666,6 +693,16 @@ static int get_space(void){
- // it should round it down to outburst*n
- // return: number of bytes played
- static int play(void* data,int len,int flags){
-+#ifdef __OpenBSD__
-+    if(len==0)
-+        return len;
-+    if(len>ao_data.outburst || !(flags & AOPLAY_FINAL_CHUNK)) {
-+        len/=ao_data.outburst;
-+        len*=ao_data.outburst;
-+    }
-+    len=write(audio_fd,data,len);
-+    return len;
-+#else
-     if (len < ao_data.outburst) return 0;
-     len /= ao_data.outburst;
-     len *= ao_data.outburst;
-@@ -679,16 +716,19 @@ static int play(void* data,int len,int flags){
-    queued_bursts ++;
-     }
-     return len;
-+#endif
- }
-
-
- // return: delay in seconds between first and last sample in buffer
- static float get_delay(void){
--    audio_info_t info;
--    ioctl(audio_fd, AUDIO_GETINFO, &info);
- #if defined (__OpenBSD__) || defined(__NetBSD__)
--    return (float) info.play.seek/ (float)byte_per_sec ;
-+    u_long bytes;
-+    ioctl(audio_fd, AUDIO_WSEEK, &bytes);
-+    return (float) bytes/ (float)byte_per_sec ;
- #else
-+    audio_info_t info;
-+    ioctl(audio_fd, AUDIO_GETINFO, &info);
-     if (info.play.samples && enable_sample_timing == RTSC_ENABLED)
- return (float)(queued_samples - info.play.samples) / (float)ao_data.samplerate;
-     else
diff -urNa mplayer/patches/patch-libao2_audio_out_c mplayer.new/patches/patch-libao2_audio_out_c
--- mplayer/patches/patch-libao2_audio_out_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libao2_audio_out_c Thu Jan  1 01:00:00 1970
@@ -1,38 +0,0 @@
---- libao2/audio_out.c.orig Sun Oct  7 21:49:27 2007
-+++ libao2/audio_out.c Tue Oct 14 11:48:58 2008
-@@ -53,6 +53,9 @@ extern ao_functions_t audio_out_sdl;
- #ifdef USE_SUN_AUDIO
- extern ao_functions_t audio_out_sun;
- #endif
-+#ifdef USE_LIBSNDIO_AUDIO
-+extern ao_functions_t audio_out_libsndio;
-+#endif
- #ifdef USE_SGI_AUDIO
- extern ao_functions_t audio_out_sgi;
- #endif
-@@ -74,6 +77,7 @@ extern ao_functions_t audio_out_v4l2;
- extern ao_functions_t audio_out_mpegpes;
- extern ao_functions_t audio_out_pcm;
- extern ao_functions_t audio_out_pss;
-+extern ao_functions_t audio_out_rtunes;
-
- ao_functions_t* audio_out_drivers[] =
- {
-@@ -102,6 +106,9 @@ ao_functions_t* audio_out_drivers[] =
- #ifdef USE_SGI_AUDIO
-         &audio_out_sgi,
- #endif
-+#ifdef USE_LIBSNDIO_AUDIO
-+        &audio_out_libsndio,
-+#endif
- #ifdef USE_SUN_AUDIO
-         &audio_out_sun,
- #endif
-@@ -140,6 +147,7 @@ ao_functions_t* audio_out_drivers[] =
-         &audio_out_null,
- // should not be auto-selected:
- &audio_out_pcm,
-+ &audio_out_rtunes,
- NULL
- };
-
diff -urNa mplayer/patches/patch-libavcodec_Makefile mplayer.new/patches/patch-libavcodec_Makefile
--- mplayer/patches/patch-libavcodec_Makefile Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libavcodec_Makefile Thu Jan  1 01:00:00 1970
@@ -1,13 +0,0 @@
-$OpenBSD: patch-libavcodec_Makefile,v 1.7 2008/02/08 17:32:41 jakemsr Exp $
---- libavcodec/Makefile.orig Sun Oct  7 12:49:37 2007
-+++ libavcodec/Makefile Mon Jan 21 14:07:36 2008
-@@ -420,6 +420,9 @@ ALTIVEC-OBJS-$(CONFIG_WMV3_DECODER)    += ppc/vc1dsp_a
- # -maltivec is needed in order to build AltiVec code.
- $(ALTIVEC-OBJS-yes): CFLAGS += -maltivec -mabi=altivec
-
-+# compiler optimizations cause problems
-+ppc/mpegvideo_altivec.o: CFLAGS += -O
-+
- # check_altivec must be built without -maltivec
- OBJS-$(HAVE_ALTIVEC)                   += $(ALTIVEC-OBJS-yes)       \
-                                           ppc/check_altivec.o
diff -urNa mplayer/patches/patch-libavcodec_dsputil_c mplayer.new/patches/patch-libavcodec_dsputil_c
--- mplayer/patches/patch-libavcodec_dsputil_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libavcodec_dsputil_c Thu Jan  1 01:00:00 1970
@@ -1,22 +0,0 @@
-$OpenBSD: patch-libavcodec_dsputil_c,v 1.1 2008/02/08 17:32:41 jakemsr Exp $
---- libavcodec/dsputil.c.orig Sun Oct  7 12:49:37 2007
-+++ libavcodec/dsputil.c Mon Feb  4 16:24:38 2008
-@@ -39,7 +39,9 @@
- void ff_spatial_dwt(int *buffer, int width, int height, int stride, int type, int decomposition_count);
-
- /* vorbis.c */
-+#if ENABLE_VORBIS_DECODER
- void vorbis_inverse_coupling(float *mag, float *ang, int blocksize);
-+#endif
-
- /* flacenc.c */
- void ff_flac_compute_autocorr(const int32_t *data, int len, int lag, double *autoc);
-@@ -3850,7 +3852,7 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx
- {
-     int i;
-
--    ff_check_alignment();
-+    /*ff_check_alignment();*/
-
- #ifdef CONFIG_ENCODERS
-     if(avctx->dct_algo==FF_DCT_FASTINT) {
diff -urNa mplayer/patches/patch-libavcodec_h264_c mplayer.new/patches/patch-libavcodec_h264_c
--- mplayer/patches/patch-libavcodec_h264_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libavcodec_h264_c Thu Jan  1 01:00:00 1970
@@ -1,12 +0,0 @@
-$OpenBSD: patch-libavcodec_h264_c,v 1.1 2008/02/08 17:32:41 jakemsr Exp $
---- libavcodec/h264.c.orig Mon Jan 21 13:58:41 2008
-+++ libavcodec/h264.c Mon Jan 21 14:00:06 2008
-@@ -5241,7 +5241,7 @@ static inline int get_cabac_cbf_ctx( H264Context *h, i
-     return ctx + 4 * cat;
- }
-
--static const attribute_used uint8_t last_coeff_flag_offset_8x8[63] = {
-+const attribute_used uint8_t last_coeff_flag_offset_8x8[63] = {
-     0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-     3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
diff -urNa mplayer/patches/patch-libavcodec_libx264_c mplayer.new/patches/patch-libavcodec_libx264_c
--- mplayer/patches/patch-libavcodec_libx264_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libavcodec_libx264_c Thu Jan  1 01:00:00 1970
@@ -1,29 +0,0 @@
-$OpenBSD: patch-libavcodec_libx264_c,v 1.1 2009/04/14 19:52:08 kili Exp $
---- libavcodec/libx264.c.orig Sun Jan  4 00:43:21 2009
-+++ libavcodec/libx264.c Sun Jan  4 00:44:24 2009
-@@ -162,7 +162,7 @@ X264_init(AVCodecContext *avctx)
-
-     x4->params.i_bframe = avctx->max_b_frames;
-     x4->params.b_cabac = avctx->coder_type == FF_CODER_TYPE_AC;
--    x4->params.b_bframe_adaptive = avctx->b_frame_strategy;
-+    x4->params.i_bframe_adaptive = avctx->b_frame_strategy;
-     x4->params.i_bframe_bias = avctx->bframebias;
-     x4->params.b_bframe_pyramid = (avctx->flags2 & CODEC_FLAG2_BPYRAMID);
-     avctx->has_b_frames= (avctx->flags2 & CODEC_FLAG2_BPYRAMID) ? 2 : !!avctx->max_b_frames;
-@@ -225,8 +225,6 @@ X264_init(AVCodecContext *avctx)
-     x4->params.analyse.i_me_range = avctx->me_range;
-     x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality;
-
--    x4->params.analyse.b_bidir_me = (avctx->bidir_refine > 0);
--    x4->params.analyse.b_bframe_rdo = (avctx->flags2 & CODEC_FLAG2_BRDO);
-     x4->params.analyse.b_mixed_references =
-         (avctx->flags2 & CODEC_FLAG2_MIXED_REFS);
-     x4->params.analyse.b_chroma_me = (avctx->me_cmp & FF_CMP_CHROMA);
-@@ -251,7 +249,6 @@ X264_init(AVCodecContext *avctx)
-     x4->params.rc.f_ip_factor = 1/fabs(avctx->i_quant_factor);
-     x4->params.rc.f_pb_factor = avctx->b_quant_factor;
-     x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset;
--    x4->params.rc.psz_rc_eq = avctx->rc_eq;
-
-     x4->params.analyse.b_psnr = (avctx->flags & CODEC_FLAG_PSNR);
-     x4->params.i_log_level = X264_LOG_DEBUG;
diff -urNa mplayer/patches/patch-libavformat_4xm_c mplayer.new/patches/patch-libavformat_4xm_c
--- mplayer/patches/patch-libavformat_4xm_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libavformat_4xm_c Thu Jan  1 01:00:00 1970
@@ -1,18 +0,0 @@
-$OpenBSD: patch-libavformat_4xm_c,v 1.1 2009/01/29 17:28:13 sthen Exp $
---- libavformat/4xm.c.orig Thu Jan 29 11:19:43 2009
-+++ libavformat/4xm.c Thu Jan 29 11:20:45 2009
-@@ -163,10 +163,12 @@ static int fourxm_read_header(AVFormatContext *s,
-                 return AVERROR_INVALIDDATA;
-             }
-             current_track = AV_RL32(&header[i + 8]);
-+            if((unsigned)current_track >= UINT_MAX / sizeof(AudioTrack) - 1){
-+                av_log(s, AV_LOG_ERROR, "current_track too large\n");
-+                return -1;
-+            }
-             if (current_track + 1 > fourxm->track_count) {
-                 fourxm->track_count = current_track + 1;
--                if((unsigned)fourxm->track_count >= UINT_MAX / sizeof(AudioTrack))
--                    return -1;
-                 fourxm->tracks = av_realloc(fourxm->tracks,
-                     fourxm->track_count * sizeof(AudioTrack));
-                 if (!fourxm->tracks) {
diff -urNa mplayer/patches/patch-libavutil_x86_cpu_h mplayer.new/patches/patch-libavutil_x86_cpu_h
--- mplayer/patches/patch-libavutil_x86_cpu_h Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libavutil_x86_cpu_h Thu Jan  1 01:00:00 1970
@@ -1,12 +0,0 @@
-$OpenBSD: patch-libavutil_x86_cpu_h,v 1.1 2008/02/08 17:32:41 jakemsr Exp $
---- libavutil/x86_cpu.h.orig Sat Jan 26 15:11:55 2008
-+++ libavutil/x86_cpu.h Sat Jan 26 15:14:22 2008
-@@ -61,7 +61,7 @@
- #  define HAVE_7REGS 1
- #endif
-
--#if defined(ARCH_X86_64) && defined(PIC)
-+#if defined(ARCH_X86_64)  /* && defined(PIC)) the stuff under this condition just isn't amd64 compatible */  
- #  define BROKEN_RELOCATIONS 1
- #endif
-
diff -urNa mplayer/patches/patch-libdvdcss_Makefile mplayer.new/patches/patch-libdvdcss_Makefile
--- mplayer/patches/patch-libdvdcss_Makefile Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libdvdcss_Makefile Thu Jan  1 01:00:00 1970
@@ -1,12 +0,0 @@
-$OpenBSD: patch-libdvdcss_Makefile,v 1.1 2008/02/08 17:32:41 jakemsr Exp $
---- libdvdcss/Makefile.orig Mon Jan 21 15:05:17 2008
-+++ libdvdcss/Makefile Mon Jan 21 15:05:34 2008
-@@ -9,6 +9,6 @@ SRCS_COMMON = css.c \
-               libdvdcss.c \
-               #bsdi_ioctl \
-
--CFLAGS = -D__USE_UNIX98 -D_GNU_SOURCE -DVERSION=\"1.2.9\"
--
- include ../mpcommon.mak
-+
-+CFLAGS += -D__USE_UNIX98 -D_GNU_SOURCE -DVERSION=\"1.2.9\"
diff -urNa mplayer/patches/patch-libmpcodecs_ad_faad_c mplayer.new/patches/patch-libmpcodecs_ad_faad_c
--- mplayer/patches/patch-libmpcodecs_ad_faad_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libmpcodecs_ad_faad_c Thu Jan  1 01:00:00 1970
@@ -1,30 +0,0 @@
-$OpenBSD: patch-libmpcodecs_ad_faad_c,v 1.2 2008/09/15 22:13:02 jakemsr Exp $
---- libmpcodecs/ad_faad.c.orig Sun Oct  7 12:49:25 2007
-+++ libmpcodecs/ad_faad.c Wed Jul 16 01:50:40 2008
-@@ -66,7 +66,7 @@ static int aac_probe(unsigned char *buffer, int len)
-
- static int init(sh_audio_t *sh)
- {
--  unsigned long faac_samplerate;
-+  unsigned int faac_samplerate;
-   unsigned char faac_channels;
-   int faac_init, pos = 0;
-   faac_hdec = faacDecOpen();
-@@ -148,7 +148,7 @@ static int init(sh_audio_t *sh)
-     return 0;
-   } else {
-     mp_msg(MSGT_DECAUDIO,MSGL_V,"FAAD: Decoder init done (%dBytes)!\n", sh->a_in_buffer_len); // XXX: remove or move to debug!
--    mp_msg(MSGT_DECAUDIO,MSGL_V,"FAAD: Negotiated samplerate: %ldHz  channels: %d\n", faac_samplerate, faac_channels);
-+    mp_msg(MSGT_DECAUDIO,MSGL_V,"FAAD: Negotiated samplerate: %dHz  channels: %d\n", faac_samplerate, faac_channels);
-     sh->channels = faac_channels;
-     if (audio_output_channels <= 2) sh->channels = faac_channels > 1 ? 2 : 1;
-     sh->samplerate = faac_samplerate;
-@@ -276,7 +276,7 @@ static int decode_audio(sh_audio_t *sh,unsigned char *
-     } else {
-       /* XXX: samples already multiplied by channels! */
-       mp_msg(MSGT_DECAUDIO,MSGL_DBG2,"FAAD: Successfully decoded frame (%ld Bytes)!\n",
--      sh->samplesize*faac_finfo.samples);
-+      (long)sh->samplesize*faac_finfo.samples);
-       memcpy(buf+len,faac_sample_buffer, sh->samplesize*faac_finfo.samples);
-       last_dec_len = sh->samplesize*faac_finfo.samples;
-       len += last_dec_len;
diff -urNa mplayer/patches/patch-libmpcodecs_ad_pcm_c mplayer.new/patches/patch-libmpcodecs_ad_pcm_c
--- mplayer/patches/patch-libmpcodecs_ad_pcm_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libmpcodecs_ad_pcm_c Thu Jan  1 01:00:00 1970
@@ -1,12 +0,0 @@
-$OpenBSD: patch-libmpcodecs_ad_pcm_c,v 1.3 2006/07/19 21:40:47 robert Exp $
---- libmpcodecs/ad_pcm.c.orig Sun Jun 11 20:35:41 2006
-+++ libmpcodecs/ad_pcm.c Thu Jul  6 00:08:11 2006
-@@ -20,6 +20,8 @@ LIBAD_EXTERN(pcm)
- static int init(sh_audio_t *sh_audio)
- {
-   WAVEFORMATEX *h=sh_audio->wf;
-+  if (!h)
-+    return 0;
-   sh_audio->i_bps=h->nAvgBytesPerSec;
-   sh_audio->channels=h->nChannels;
-   sh_audio->samplerate=h->nSamplesPerSec;
diff -urNa mplayer/patches/patch-libmpdemux_demux_audio_c mplayer.new/patches/patch-libmpdemux_demux_audio_c
--- mplayer/patches/patch-libmpdemux_demux_audio_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libmpdemux_demux_audio_c Thu Jan  1 01:00:00 1970
@@ -1,12 +0,0 @@
-$OpenBSD: patch-libmpdemux_demux_audio_c,v 1.1 2008/02/11 00:22:03 jakemsr Exp $
---- libmpdemux/demux_audio.c.orig Fri Feb  8 13:28:43 2008
-+++ libmpdemux/demux_audio.c Fri Feb  8 13:29:10 2008
-@@ -229,6 +229,8 @@ get_flac_metadata (demuxer_t* demuxer)
-           ptr += 4;
-
-           comment = ptr;
-+          if (&comment[length] < comments || &comment[length] >= &comments[blk_len])
-+            return;
-           c = comment[length];
-           comment[length] = 0;
-
diff -urNa mplayer/patches/patch-libmpdemux_demux_mov_c mplayer.new/patches/patch-libmpdemux_demux_mov_c
--- mplayer/patches/patch-libmpdemux_demux_mov_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libmpdemux_demux_mov_c Thu Jan  1 01:00:00 1970
@@ -1,36 +0,0 @@
-$OpenBSD: patch-libmpdemux_demux_mov_c,v 1.3 2008/02/11 00:22:03 jakemsr Exp $
---- libmpdemux/demux_mov.c.orig Fri Feb  8 13:29:41 2008
-+++ libmpdemux/demux_mov.c Fri Feb  8 13:31:59 2008
-@@ -173,11 +173,12 @@ void mov_build_index(mov_track_t* trak,int timescale){
-     i=trak->chunkmap_size;
-     while(i>0){
- --i;
-- for(j=trak->chunkmap[i].first;j<last;j++){
-+ j=FFMAX(trak->chunkmap[i].first, 0);
-+ for(;j<last;j++){
-    trak->chunks[j].desc=trak->chunkmap[i].sdid;
-    trak->chunks[j].size=trak->chunkmap[i].spc;
- }
-- last=trak->chunkmap[i].first;
-+ last=FFMIN(trak->chunkmap[i].first, trak->chunks_size);
-     }
-
- #if 0
-@@ -235,6 +236,8 @@ void mov_build_index(mov_track_t* trak,int timescale){
-     s=0;
-     for(j=0;j<trak->durmap_size;j++){
- for(i=0;i<trak->durmap[j].num;i++){
-+    if (s >= trak->samples_size)
-+ break;
-    trak->samples[s].pts=pts;
-    ++s;
-    pts+=trak->durmap[j].dur;
-@@ -246,6 +249,8 @@ void mov_build_index(mov_track_t* trak,int timescale){
-     for(j=0;j<trak->chunks_size;j++){
- off_t pos=trak->chunks[j].pos;
- for(i=0;i<trak->chunks[j].size;i++){
-+    if (s >= trak->samples_size)
-+ break;
-    trak->samples[s].pos=pos;
-    mp_msg(MSGT_DEMUX, MSGL_DBG3, "Sample %5d: pts=%8d  off=0x%08X  size=%d\n",s,
- trak->samples[s].pts,
diff -urNa mplayer/patches/patch-libmpdemux_demux_real_c mplayer.new/patches/patch-libmpdemux_demux_real_c
--- mplayer/patches/patch-libmpdemux_demux_real_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libmpdemux_demux_real_c Thu Jan  1 01:00:00 1970
@@ -1,27 +0,0 @@
-$OpenBSD: patch-libmpdemux_demux_real_c,v 1.3 2008/10/01 16:01:51 naddy Exp $
---- libmpdemux/demux_real.c.orig Sun Oct  7 21:49:33 2007
-+++ libmpdemux/demux_real.c Tue Sep 30 16:34:43 2008
-@@ -958,6 +958,7 @@ got_video:
-    // last fragment!
-    if(dp_hdr->len!=vpkg_length-vpkg_offset)
- mp_msg(MSGT_DEMUX,MSGL_V,"warning! assembled.len=%d  frag.len=%d  total.len=%d  \n",dp->len,vpkg_offset,vpkg_length-vpkg_offset);
-+    if (vpkg_offset > dp->len - sizeof(dp_hdr_t) - dp_hdr->len) vpkg_offset = dp->len - sizeof(dp_hdr_t) - dp_hdr->len;
-                stream_read(demuxer->stream, dp_data+dp_hdr->len, vpkg_offset);
-    if((dp_data[dp_hdr->len]&0x20) && (sh_video->format==0x30335652)) --dp_hdr->chunks; else
-    dp_hdr->len+=vpkg_offset;
-@@ -981,6 +982,7 @@ got_video:
- // non-last fragment:
- if(dp_hdr->len!=vpkg_offset)
-    mp_msg(MSGT_DEMUX,MSGL_V,"warning! assembled.len=%d  offset=%d  frag.len=%d  total.len=%d  \n",dp->len,vpkg_offset,len,vpkg_length);
-+ if (len > dp->len - sizeof(dp_hdr_t) - dp_hdr->len) len = dp->len - sizeof(dp_hdr_t) - dp_hdr->len;
-             stream_read(demuxer->stream, dp_data+dp_hdr->len, len);
- if((dp_data[dp_hdr->len]&0x20) && (sh_video->format==0x30335652)) --dp_hdr->chunks; else
- dp_hdr->len+=len;
-@@ -1003,6 +1005,7 @@ got_video:
- extra[0]=1; extra[1]=0; // offset of the first chunk
- if(0x00==(vpkg_header&0xc0)){
-    // first fragment:
-+    if (len > dp->len - sizeof(dp_hdr_t)) len = dp->len - sizeof(dp_hdr_t);
-    dp_hdr->len=len;
-    stream_read(demuxer->stream, dp_data, len);
-    ds->asf_packet=dp;
diff -urNa mplayer/patches/patch-libmpdemux_demux_vqf_c mplayer.new/patches/patch-libmpdemux_demux_vqf_c
--- mplayer/patches/patch-libmpdemux_demux_vqf_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libmpdemux_demux_vqf_c Thu Jan  1 01:00:00 1970
@@ -1,56 +0,0 @@
-$OpenBSD: patch-libmpdemux_demux_vqf_c,v 1.1 2008/12/15 21:30:07 naddy Exp $
---- libmpdemux/demux_vqf.c.orig Sun Oct  7 21:49:33 2007
-+++ libmpdemux/demux_vqf.c Mon Dec 15 19:10:38 2008
-@@ -50,11 +50,14 @@ static demuxer_t* demux_open_vqf(demuxer_t* demuxer) {
-     unsigned chunk_size;
-     hi->size=chunk_size=stream_read_dword(s); /* include itself */
-     stream_read(s,chunk_id,4);
-+    if (chunk_size < 8) return NULL;
-+    chunk_size -= 8;
-     if(*((uint32_t *)&chunk_id[0])==mmioFOURCC('C','O','M','M'))
-     {
--    char buf[chunk_size-8];
-+    char buf[BUFSIZ];
-     unsigned i,subchunk_size;
--    if(stream_read(s,buf,chunk_size-8)!=chunk_size-8) return NULL;
-+    if (chunk_size > sizeof(buf) || chunk_size < 20) return NULL;
-+    if(stream_read(s,buf,chunk_size)!=chunk_size) return NULL;
-     i=0;
-     subchunk_size=be2me_32(*((uint32_t *)&buf[0]));
-     hi->channelMode=be2me_32(*((uint32_t *)&buf[4]));
-@@ -83,13 +86,15 @@ static demuxer_t* demux_open_vqf(demuxer_t* demuxer) {
-     sh_audio->samplesize = 4;
-     w->wBitsPerSample = 8*sh_audio->samplesize;
-     w->cbSize = 0;
-+    if (subchunk_size > chunk_size - 4) continue;
-     i+=subchunk_size+4;
--    while(i<chunk_size-8)
-+    while(i + 8 < chunk_size)
-     {
-         unsigned slen,sid;
--        char sdata[chunk_size];
-+        char sdata[BUFSIZ];
-         sid=*((uint32_t *)&buf[i]); i+=4;
-         slen=be2me_32(*((uint32_t *)&buf[i])); i+=4;
-+        if (slen > sizeof(sdata) - 1 || slen > chunk_size - i) break;
-         if(sid==mmioFOURCC('D','S','I','Z'))
-         {
-         hi->Dsiz=be2me_32(*((uint32_t *)&buf[i]));
-@@ -141,7 +146,7 @@ static demuxer_t* demux_open_vqf(demuxer_t* demuxer) {
-     if(*((uint32_t *)&chunk_id[0])==mmioFOURCC('D','A','T','A'))
-     {
-     demuxer->movi_start=stream_tell(s);
--    demuxer->movi_end=demuxer->movi_start+chunk_size-8;
-+    demuxer->movi_end=demuxer->movi_start+chunk_size;
-     mp_msg(MSGT_DEMUX, MSGL_V, "Found data at %"PRIX64" size %"PRIu64"\n",demuxer->movi_start,demuxer->movi_end);
-     /* Done! play it */
-     break;
-@@ -149,7 +154,7 @@ static demuxer_t* demux_open_vqf(demuxer_t* demuxer) {
-     else
-     {
-     mp_msg(MSGT_DEMUX, MSGL_V, "Unhandled chunk '%c%c%c%c' %u bytes\n",((char *)&chunk_id)[0],((char *)&chunk_id)[1],((char *)&chunk_id)[2],((char *)&chunk_id)[3],chunk_size);
--    stream_skip(s,chunk_size-8); /*unknown chunk type */
-+    stream_skip(s,chunk_size); /*unknown chunk type */
-     }
-   }
-
diff -urNa mplayer/patches/patch-libpostproc_postprocess_template_c mplayer.new/patches/patch-libpostproc_postprocess_template_c
--- mplayer/patches/patch-libpostproc_postprocess_template_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-libpostproc_postprocess_template_c Thu Jan  1 01:00:00 1970
@@ -1,36 +0,0 @@
-$OpenBSD: patch-libpostproc_postprocess_template_c,v 1.1 2008/02/08 17:32:42 jakemsr Exp $
---- libpostproc/postprocess_template.c.orig Mon Jan 21 16:47:04 2008
-+++ libpostproc/postprocess_template.c Mon Jan 21 16:47:55 2008
-@@ -3747,7 +3747,7 @@ static void RENAME(postProcess)(uint8_t src[], int src
-                                 //FIXME filter first line
-                                         if(y>0) RENAME(dering)(dstBlock - stride - 8, stride, &c);
-                                 }
--
-+#if 0
-                                 if(mode & TEMP_NOISE_FILTER)
-                                 {
-                                         RENAME(tempNoiseReducer)(dstBlock-8, stride,
-@@ -3755,6 +3755,7 @@ static void RENAME(postProcess)(uint8_t src[], int src
-                                                 c.tempBluredPast[isColor] + (y>>3)*256 + (x>>3),
-                                                 c.ppMode.maxTmpNoise);
-                                 }
-+#endif
-                         }
-
-                         dstBlock+=8;
-@@ -3772,6 +3773,7 @@ static void RENAME(postProcess)(uint8_t src[], int src
-                                 if(y > 0) RENAME(dering)(dstBlock - dstStride - 8, dstStride, &c);
-                 }
-
-+#if 0
-                 if((mode & TEMP_NOISE_FILTER))
-                 {
-                         RENAME(tempNoiseReducer)(dstBlock-8, dstStride,
-@@ -3779,6 +3781,7 @@ static void RENAME(postProcess)(uint8_t src[], int src
-                                 c.tempBluredPast[isColor] + (y>>3)*256 + (x>>3),
-                                 c.ppMode.maxTmpNoise);
-                 }
-+#endif
-
-                 /* did we use a tmp buffer for the last lines*/
-                 if(y+15 >= height)
diff -urNa mplayer/patches/patch-loader_wrapper_S mplayer.new/patches/patch-loader_wrapper_S
--- mplayer/patches/patch-loader_wrapper_S Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-loader_wrapper_S Thu Jan  1 01:00:00 1970
@@ -1,93 +0,0 @@
-$OpenBSD: patch-loader_wrapper_S,v 1.3 2004/10/18 06:48:20 biorn Exp $
---- loader/wrapper.S.orig Mon Nov 25 21:37:12 2002
-+++ loader/wrapper.S Thu Jul 15 09:29:23 2004
-@@ -1,27 +1,36 @@
-+#include "../mangle.h"
-+#if defined(__OpenBSD__) && !defined(__ELF__)
-+.data
-+#else
- .section .data
--.globl caller_return
--caller_return:
-+#endif
-+.globl MANGLEA(caller_return)
-+MANGLEA(caller_return):
- .long 0
--.globl report_entry
--report_entry:
-- .long null_call
--.globl report_ret
--report_ret:
-- .long null_call
--.global wrapper_target
--wrapper_target:
-- .long null_call
-+.globl MANGLEA(report_entry)
-+MANGLEA(report_entry):
-+ .long MANGLEA(null_call)
-+.globl MANGLEA(report_ret)
-+MANGLEA(report_ret):
-+ .long MANGLEA(null_call)
-+.global MANGLEA(wrapper_target)
-+MANGLEA(wrapper_target):
-+ .long MANGLEA(null_call)
-
-+#if defined(__OpenBSD__) && !defined(__ELF__)
-+.text
-+#else
- .section .text
--.globl null_call
-- .type null_call, @function
-+#endif
-+.globl MANGLEA(null_call)
-+ .type MANGLEA(null_call), @function
- .balign 16,0x90
--null_call:
-+MANGLEA(null_call):
- ret
--.globl wrapper
-- .type wrapper, @function
-+.globl MANGLEA(wrapper)
-+ .type MANGLEA(wrapper), @function
- .balign 16,0x90
--wrapper:
-+MANGLEA(wrapper):
- pusha # store registers (EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI)
- pushf # store flags
-
-@@ -39,7 +48,7 @@ wrapper:
- push %eax
- push %edx
-
-- call *report_entry # report entry
-+ call *MANGLEA(report_entry) # report entry
-
- test %eax, %eax
- jnz .Ldone
-@@ -48,14 +57,14 @@ wrapper:
- popf # restore flags
- popa # restore registers
-
-- popl caller_return # switch return addresses
-+ popl MANGLEA(caller_return) # switch return addresses
- pushl $.Lwrapper_return
-
-- jmp *wrapper_target # wrapper_target should return at .Lwrapper_return
-+ jmp *MANGLEA(wrapper_target) # wrapper_target should return at .Lwrapper_return
-
- .balign 16, 0x90
- .Lwrapper_return:
-- pushl caller_return # restore the original return address
-+ pushl MANGLEA(caller_return) # restore the original return address
- pusha # more for reference sake here
- pushf
-
-@@ -73,7 +82,7 @@ wrapper:
- push %eax
- push %edx
-
-- call *report_ret # report the return information (same args)
-+ call *MANGLEA(report_ret) # report the return information (same args)
- .Ldone:
-
- leave
diff -urNa mplayer/patches/patch-mangle_h mplayer.new/patches/patch-mangle_h
--- mplayer/patches/patch-mangle_h Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-mangle_h Thu Jan  1 01:00:00 1970
@@ -1,14 +0,0 @@
-$OpenBSD: patch-mangle_h,v 1.4 2008/02/08 17:32:42 jakemsr Exp $
---- mangle.h.orig Sun Oct  7 12:49:33 2007
-+++ mangle.h Sun Dec 16 21:06:56 2007
-@@ -11,8 +11,10 @@
- #if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__OS2__) || \
-    (defined(__OpenBSD__) && !defined(__ELF__)) || defined(__APPLE__)
- #define MANGLE(a) "_" #a
-+#define MANGLEA(a) _ ## a
- #else
- #define MANGLE(a) #a
-+#define MANGLEA(a) a
- #endif
-
- #endif /* !MANGLE_H */
diff -urNa mplayer/patches/patch-mencoder_c mplayer.new/patches/patch-mencoder_c
--- mplayer/patches/patch-mencoder_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-mencoder_c Thu Jan  1 01:00:00 1970
@@ -1,11 +0,0 @@
-$OpenBSD: patch-mencoder_c,v 1.3 2008/02/08 17:32:42 jakemsr Exp $
---- mencoder.c.orig Sun Oct  7 12:49:33 2007
-+++ mencoder.c Sun Dec 16 21:06:56 2007
-@@ -1506,6 +1506,7 @@ if(sh_audio && !demuxer2){
-
- } // while(!at_eof)
-
-+mux_v->aspect=sh_video->aspect;
- if (!interrupted && filelist[++curfile].name != 0) {
- if (sh_video && sh_video->vfilter) { // Before uniniting sh_video and the filter chain, break apart the VE.
-   vf_instance_t * ve; // this will be the filter right before the ve.
diff -urNa mplayer/patches/patch-mp3lib_layer2_c mplayer.new/patches/patch-mp3lib_layer2_c
--- mplayer/patches/patch-mp3lib_layer2_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-mp3lib_layer2_c Thu Jan  1 01:00:00 1970
@@ -1,15 +0,0 @@
-$OpenBSD: patch-mp3lib_layer2_c,v 1.5 2007/04/19 08:37:09 ajacoutot Exp $
---- mp3lib/layer2.c.orig Sun Jun 11 20:35:43 2006
-+++ mp3lib/layer2.c Thu Apr 19 09:41:04 2007
-@@ -294,6 +294,11 @@ static int do_layer2(struct frame *fr,int outmode)
-   fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ?
-      (fr->mode_ext<<2)+4 : fr->II_sblimit;
-
-+  if (fr->jsbound > fr->II_sblimit) {
-+         fprintf(stderr, "Truncating stereo boundary to sideband limit.\n");
-+         fr->jsbound=fr->II_sblimit;
-+  }
-+
-   if(stereo == 1 || single == 3)
-     single = 0;
-
diff -urNa mplayer/patches/patch-mpcommon_mak mplayer.new/patches/patch-mpcommon_mak
--- mplayer/patches/patch-mpcommon_mak Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-mpcommon_mak Thu Jan  1 01:00:00 1970
@@ -1,12 +0,0 @@
-$OpenBSD: patch-mpcommon_mak,v 1.1 2008/02/08 17:32:42 jakemsr Exp $
---- mpcommon.mak.orig Mon Jan 21 14:55:57 2008
-+++ mpcommon.mak Mon Jan 21 14:56:09 2008
-@@ -8,7 +8,7 @@ OBJS_MENCODER  += $(addsuffix .o, $(basename $(SRCS_ME
-
- CFLAGS-$(LIBAVCODEC)     += -I../libavcodec
- CFLAGS-$(LIBAVFORMAT)    += -I../libavformat
--CFLAGS += $(CFLAGS-yes) $(OPTFLAGS)
-+CFLAGS := $(CFLAGS-yes) $(OPTFLAGS)
-
- LIBS-$(MPLAYER)  += $(LIBNAME_MPLAYER)
- LIBS-$(MENCODER) += $(LIBNAME_MENCODER)
diff -urNa mplayer/patches/patch-mplayer_c mplayer.new/patches/patch-mplayer_c
--- mplayer/patches/patch-mplayer_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-mplayer_c Thu Jan  1 01:00:00 1970
@@ -1,12 +0,0 @@
-$OpenBSD: patch-mplayer_c,v 1.8 2008/02/08 17:32:42 jakemsr Exp $
---- mplayer.c.orig Sun Oct  7 12:49:33 2007
-+++ mplayer.c Sun Dec 16 21:06:56 2007
-@@ -774,7 +774,7 @@ static void exit_sighandler(int x){
-         gdb_pid = fork();
-         mp_msg(MSGT_CPLAYER, MSGL_INFO, "Forked...\n");
-         if (gdb_pid == 0) { // We are the child
--          if (execlp("gdb", "gdb", prog_path, spid, NULL) == -1)
-+          if (execlp("gdb", "gdb", prog_path, spid, (char *)NULL) == -1)
-             mp_msg(MSGT_CPLAYER, MSGL_ERR, "Couldn't start gdb\n");
-         } else if (gdb_pid < 0)
-           mp_msg(MSGT_CPLAYER, MSGL_ERR, "Couldn't fork\n");
diff -urNa mplayer/patches/patch-stream_Makefile mplayer.new/patches/patch-stream_Makefile
--- mplayer/patches/patch-stream_Makefile Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-stream_Makefile Thu Jan  1 01:00:00 1970
@@ -1,12 +0,0 @@
-$OpenBSD: patch-stream_Makefile,v 1.1 2008/02/08 17:32:42 jakemsr Exp $
---- stream/Makefile.orig Sun Oct  7 12:49:26 2007
-+++ stream/Makefile Mon Jan 21 12:13:35 2008
-@@ -66,6 +66,8 @@ endif
-
- include ../mpcommon.mak
-
-+stream_dvd.o: CFLAGS := -I.. $(CFLAGS)
-+
- clean::
- rm -f realrtsp/*.o realrtsp/*.a realrtsp/*~ \
- librtsp/*.o librtsp/*.a librtsp/*~ \
diff -urNa mplayer/patches/patch-stream_stream_cddb_c mplayer.new/patches/patch-stream_stream_cddb_c
--- mplayer/patches/patch-stream_stream_cddb_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-stream_stream_cddb_c Thu Jan  1 01:00:00 1970
@@ -1,33 +0,0 @@
-$OpenBSD: patch-stream_stream_cddb_c,v 1.1 2008/02/11 00:22:03 jakemsr Exp $
---- stream/stream_cddb.c.orig Fri Feb  8 13:34:13 2008
-+++ stream/stream_cddb.c Fri Feb  8 13:38:40 2008
-@@ -53,6 +53,7 @@
- #include "version.h"
- #include "stream.h"
- #include "network.h"
-+#include "libavutil/intreadwrite.h"
-
- #define DEFAULT_FREEDB_SERVER "freedb.freedb.org"
- #define DEFAULT_CACHE_DIR "/.cddb/"
-@@ -453,8 +454,9 @@ cddb_parse_matches_list(HTTP_header_t *http_hdr, cddb_
- } else {
- len = ptr2-ptr+1;
- }
-+ len = FFMIN(sizeof(album_title) - 1, len);
- strncpy(album_title, ptr, len);
-- album_title[len-2]='\0';
-+ album_title[len]='\0';
- }
- mp_msg(MSGT_DEMUX, MSGL_STATUS, MSGTR_MPDEMUX_CDDB_ParseOKFoundAlbumTitle, album_title);
- return 0;
-@@ -490,8 +492,9 @@ cddb_query_parse(HTTP_header_t *http_hdr, cddb_data_t
- } else {
- len = ptr2-ptr+1;
- }
-+ len = FFMIN(sizeof(album_title) - 1, len);
- strncpy(album_title, ptr, len);
-- album_title[len-2]='\0';
-+ album_title[len]='\0';
- }
- mp_msg(MSGT_DEMUX, MSGL_STATUS, MSGTR_MPDEMUX_CDDB_ParseOKFoundAlbumTitle, album_title);
- return cddb_request_titles(cddb_data);
diff -urNa mplayer/patches/patch-stream_tvi_bsdbt848_c mplayer.new/patches/patch-stream_tvi_bsdbt848_c
--- mplayer/patches/patch-stream_tvi_bsdbt848_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-stream_tvi_bsdbt848_c Thu Jan  1 01:00:00 1970
@@ -1,200 +0,0 @@
-$OpenBSD: patch-stream_tvi_bsdbt848_c,v 1.1 2008/02/08 17:32:42 jakemsr Exp $
---- stream/tvi_bsdbt848.c.orig Sun Oct  7 12:49:26 2007
-+++ stream/tvi_bsdbt848.c Mon Dec 17 14:49:10 2007
-@@ -36,6 +36,7 @@
- #include <sys/time.h>
- #include <signal.h>
- #include <string.h>
-+#include <errno.h>
-
- #include <sys/param.h>
- #ifdef USE_SUN_AUDIO
-@@ -50,6 +51,7 @@
- #include IOCTL_BT848_H_NAME
- #endif
-
-+#ifndef __OpenBSD__
- #ifdef HAVE_SYS_SOUNDCARD_H
- #include <sys/soundcard.h>
- #else
-@@ -59,6 +61,7 @@
- #include <machine/soundcard.h>
- #endif
- #endif
-+#endif
-
- #include "libaf/af_format.h"
- #include "libmpcodecs/img_format.h"
-@@ -141,9 +144,14 @@ typedef struct {
-
- #include "tvi_def.h"
-
-+static int sources[6] = { METEOR_INPUT_DEV1, METEOR_INPUT_DEV0, METEOR_INPUT_DEV2,
-+    METEOR_INPUT_DEV3, METEOR_INPUT_DEV_RGB, METEOR_INPUT_DEV_SVIDEO };
-+
-+
- static priv_t *G_private=NULL;
-
- static int getinput(int innumber);
-+static int getsource(int insrc);
-
- static void processframe(int signal)
- {
-@@ -314,7 +322,14 @@ static int control(priv_t *priv, int cmd, void *arg)
-         {
-         int dspspeed = *(int *)arg;
-
-+#if defined(__OpenBSD__)
-+           audio_info_t audio_if;
-+           AUDIO_INITINFO(&audio_if);
-+           audio_if.record.sample_rate = dspspeed;
-+           if (ioctl(priv->dspfd, AUDIO_SETINFO, &audio_if) == -1)
-+#else
-            if(ioctl(priv->dspfd, SNDCTL_DSP_SPEED, &dspspeed) == -1)
-+#endif
-             {
-             mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848InvalidAudioRate, strerror(errno));
-             return(TVI_CONTROL_FALSE);
-@@ -525,7 +540,12 @@ static int init(priv_t *priv)
- int marg;
- int count;
- u_short tmp_fps;
-+int tuner_audio;
-+#if defined(__OpenBSD__)
-+audio_info_t audio_if;
-+#endif
-
-+
- G_private = priv; /* Oooh, sick */
-
- /* Video Configuration */
-@@ -536,7 +556,7 @@ priv->iformat = METEOR_FMT_PAL;
- priv->maxheight = PAL_HEIGHT;
- priv->maxwidth = PAL_WIDTH;
- priv->maxfps = PAL_FPS;
--priv->source = METEOR_INPUT_DEV0;
-+priv->source = METEOR_INPUT_DEV1;
- priv->fps = priv->maxfps;
-
- priv->starttime=0;
-@@ -622,13 +642,33 @@ if(priv->tunerfd < 0)
-     priv->tunerready = FALSE;
-     }
-
-+if(ioctl(priv->tunerfd, BT848_GAUDIO, &tuner_audio) < 0)
-+    {
-+    perror("tuner get audio");
-+    priv->tunerready = FALSE;
-+    }
-+if(tuner_audio & AUDIO_MUTE)
-+    {
-+    tuner_audio = AUDIO_UNMUTE;
-+    if(ioctl(priv->tunerfd, BT848_SAUDIO, &tuner_audio) < 0)
-+        {
-+        perror("tuner unmute");
-+        priv->tunerready = FALSE;
-+        }
-+    }
-+
-+
- /* Audio Configuration */
-
- priv->dspready = TRUE;
- priv->dspsamplesize = 16;
- priv->dspstereo = 1;
- priv->dspspeed = 44100;
-+#if defined (__OpenBSD__)
-+priv->dspfmt = AUDIO_ENCODING_SLINEAR_LE;
-+#else
- priv->dspfmt = AFMT_S16_LE;
-+#endif
- priv->dspbytesread = 0;
- priv->dsprate = priv->dspspeed * priv->dspsamplesize/8*(priv->dspstereo+1);
- priv->dspframesize = priv->dspspeed*priv->dspsamplesize/8/priv->fps *
-@@ -642,6 +682,26 @@ if((priv->dspfd = open (priv->dspdev, O_RDONLY, 0)) <
-
- marg = (256 << 16) | 12;
-
-+#if defined(__OpenBSD__)
-+
-+    AUDIO_INITINFO(&audio_if);
-+
-+    audio_if.record.precision = priv->dspsamplesize;
-+    audio_if.record.channels = priv->dspstereo+1;
-+    audio_if.record.sample_rate = priv->dspspeed;
-+    audio_if.record.encoding = priv->dspfmt;
-+
-+    audio_if.mode = AUMODE_RECORD;
-+
-+    if (ioctl(priv->dspfd, AUDIO_SETINFO, &audio_if) < 0)
-+        {
-+        perror ("AUDIO_SETINFO:ioctl");
-+        close(priv->dspfd);
-+        priv->dspready = FALSE;
-+        }
-+
-+#else
-+
- if (ioctl(priv->dspfd, SNDCTL_DSP_SETFRAGMENT, &marg ) < 0 )
-     {
-     mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_Bt848IoctlFailed, "SNDCTL_DSP_SETFRAGMENT", strerror(errno));
-@@ -659,6 +719,8 @@ if((priv->dspready == TRUE) &&
-     priv->dspready = FALSE;
-     }
-
-+#endif
-+
- return(1);
- }
-
-@@ -703,6 +765,7 @@ return(1);
- static int uninit(priv_t *priv)
- {
- int marg;
-+int tuner_audio;
-
- if(priv->videoready == FALSE) return(0);
-
-@@ -725,6 +788,15 @@ if(ioctl(priv->btfd, METEORCAPTUR, &marg) < 0 )
- close(priv->btfd);
- close(priv->dspfd);
-
-+tuner_audio = AUDIO_MUTE;
-+if(ioctl(priv->tunerfd, BT848_SAUDIO, &tuner_audio) < 0)
-+    {
-+    perror("tuner mute");
-+    priv->tunerready = FALSE;
-+    }
-+
-+close(priv->tunerfd);
-+
- priv->dspfd = -1;
- priv->btfd = -1;
-
-@@ -869,22 +941,15 @@ if(ioctl(priv->dspfd, FIONREAD, &bytesavail) < 0)
- /* When mencoder wants audio data, it wants data..
-    it won't go do anything else until it gets it :( */
-
--if(bytesavail == 0) return FRAGSIZE;
-+// if(bytesavail == 0) return FRAGSIZE;
-
- return(bytesavail);
- }
-
- static int getinput(int innumber)
- {
--switch(innumber)
--    {
--    case 0: return METEOR_INPUT_DEV0;     /* RCA   */
--    case 1: return METEOR_INPUT_DEV1;     /* Tuner */
--    case 2: return METEOR_INPUT_DEV2;     /* In 1  */
--    case 3: return METEOR_INPUT_DEV3;     /* In 2  */
--    case 4: return METEOR_INPUT_DEV_RGB;     /* RGB   */
--    case 5: return METEOR_INPUT_DEV_SVIDEO; /* SVid  */
--    }
--
-+if (sources[innumber])
-+    return sources[innumber];
-+    
- return 0;
- }
diff -urNa mplayer/patches/patch-stream_tvi_v4l2_c mplayer.new/patches/patch-stream_tvi_v4l2_c
--- mplayer/patches/patch-stream_tvi_v4l2_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-stream_tvi_v4l2_c Wed Jul  8 19:17:03 2009
@@ -1,17 +1,19 @@
-$OpenBSD: patch-stream_tvi_v4l2_c,v 1.1 2008/09/03 12:20:52 brad Exp $
---- stream/tvi_v4l2.c.orig Mon Sep  1 22:57:10 2008
-+++ stream/tvi_v4l2.c Mon Sep  1 22:57:48 2008
-@@ -38,8 +38,13 @@ known issues:
+$OpenBSD$
+--- stream/tvi_v4l2.c.orig Wed Jul  8 19:15:35 2009
++++ stream/tvi_v4l2.c Wed Jul  8 19:16:54 2009
+@@ -49,8 +49,15 @@ known issues:
  #ifdef HAVE_SYS_SYSINFO_H
  #include <sys/sysinfo.h>
  #endif
-+#ifdef __linux__
++
++/* OpenBSD modifications <linux/*> not available */
++/*
  #include <linux/types.h>
  #include <linux/videodev2.h>
-+#endif
-+#ifdef __OpenBSD__
++*/
 +#include <sys/videoio.h>
-+#endif
++/* END OpenBSD stuff */
++
  #include "mp_msg.h"
  #include "libmpcodecs/img_format.h"
  #include "libaf/af_format.h"
diff -urNa mplayer/patches/patch-stream_tvi_v4l2_c~ mplayer.new/patches/patch-stream_tvi_v4l2_c~
--- mplayer/patches/patch-stream_tvi_v4l2_c~ Thu Jan  1 01:00:00 1970
+++ mplayer.new/patches/patch-stream_tvi_v4l2_c~ Wed Jul  8 19:16:57 2009
@@ -0,0 +1,19 @@
+$OpenBSD$
+--- stream/tvi_v4l2.c.orig Wed Jul  8 19:15:35 2009
++++ stream/tvi_v4l2.c Wed Jul  8 19:16:54 2009
+@@ -49,8 +49,15 @@ known issues:
+ #ifdef HAVE_SYS_SYSINFO_H
+ #include <sys/sysinfo.h>
+ #endif
++
++/* OpenBSD modifications <linux/*> not available */
++/*
+ #include <linux/types.h>
+ #include <linux/videodev2.h>
++*/
++#include <sys/videoio.h>
++/* END OpenBSD stuff */
++
+ #include "mp_msg.h"
+ #include "libmpcodecs/img_format.h"
+ #include "libaf/af_format.h"
diff -urNa mplayer/patches/patch-stream_url_c mplayer.new/patches/patch-stream_url_c
--- mplayer/patches/patch-stream_url_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-stream_url_c Thu Jan  1 01:00:00 1970
@@ -1,11 +0,0 @@
-$OpenBSD: patch-stream_url_c,v 1.1 2008/02/11 00:22:03 jakemsr Exp $
---- stream/url.c.orig Fri Feb  8 13:32:35 2008
-+++ stream/url.c Fri Feb  8 13:33:05 2008
-@@ -328,6 +328,7 @@ url_escape_string(char *outbuf, const char *inbuf) {
- }
- }
-
-+ tmp = NULL;
- while(i < len) {
- // look for the next char that must be kept
- for  (j=i;j<len;j++) {
diff -urNa mplayer/patches/patch-tremor_block_c mplayer.new/patches/patch-tremor_block_c
--- mplayer/patches/patch-tremor_block_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-tremor_block_c Thu Jan  1 01:00:00 1970
@@ -1,11 +0,0 @@
-$OpenBSD: patch-tremor_block_c,v 1.1 2008/03/30 20:39:41 fgsch Exp $
---- tremor/block.c.orig Sun Oct  7 20:49:27 2007
-+++ tremor/block.c Sun Mar 30 22:26:40 2008
-@@ -25,6 +25,7 @@
- #include "window.h"
- #include "registry.h"
- #include "misc.h"
-+#include "block.h"
-
- static int ilog(unsigned int v){
-   int ret=0;
diff -urNa mplayer/patches/patch-tremor_block_h mplayer.new/patches/patch-tremor_block_h
--- mplayer/patches/patch-tremor_block_h Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-tremor_block_h Thu Jan  1 01:00:00 1970
@@ -1,28 +0,0 @@
-$OpenBSD: patch-tremor_block_h,v 1.1 2008/03/30 20:39:41 fgsch Exp $
---- tremor/block.h.orig Sat Mar 29 16:17:25 2008
-+++ tremor/block.h Sat Mar 29 16:17:25 2008
-@@ -0,0 +1,24 @@
-+/********************************************************************
-+ *                                                                  *
-+ * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE.   *
-+ *                                                                  *
-+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
-+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
-+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
-+ *                                                                  *
-+ * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002    *
-+ * BY THE Xiph.Org FOUNDATION http://www.xiph.org/                  *
-+ *                                                                  *
-+ ********************************************************************
-+
-+ function: basic shared block operations
-+
-+ ********************************************************************/
-+
-+#ifndef _V_BLOCK_H_
-+#define _V_BLOCK_H_
-+
-+void *_vorbis_block_alloc(vorbis_block *vb,long bytes);
-+void _vorbis_block_ripcord(vorbis_block *vb);
-+
-+#endif
diff -urNa mplayer/patches/patch-tremor_floor0_c mplayer.new/patches/patch-tremor_floor0_c
--- mplayer/patches/patch-tremor_floor0_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-tremor_floor0_c Thu Jan  1 01:00:00 1970
@@ -1,11 +0,0 @@
-$OpenBSD: patch-tremor_floor0_c,v 1.1 2008/03/30 20:39:41 fgsch Exp $
---- tremor/floor0.c.orig Sun Oct  7 20:49:27 2007
-+++ tremor/floor0.c Sun Mar 30 22:26:40 2008
-@@ -25,6 +25,7 @@
- #include "codebook.h"
- #include "misc.h"
- #include "os.h"
-+#include "block.h"
-
- #define LSP_FRACBITS 14
-
diff -urNa mplayer/patches/patch-tremor_floor1_c mplayer.new/patches/patch-tremor_floor1_c
--- mplayer/patches/patch-tremor_floor1_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-tremor_floor1_c Thu Jan  1 01:00:00 1970
@@ -1,11 +0,0 @@
-$OpenBSD: patch-tremor_floor1_c,v 1.1 2008/03/30 20:39:41 fgsch Exp $
---- tremor/floor1.c.orig Sun Oct  7 20:49:27 2007
-+++ tremor/floor1.c Sun Mar 30 22:26:40 2008
-@@ -24,6 +24,7 @@
- #include "registry.h"
- #include "codebook.h"
- #include "misc.h"
-+#include "block.h"
-
- #define floor1_rangedB 140 /* floor 1 fixed at -140dB to 0dB range */
-
diff -urNa mplayer/patches/patch-tremor_res012_c mplayer.new/patches/patch-tremor_res012_c
--- mplayer/patches/patch-tremor_res012_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-tremor_res012_c Thu Jan  1 01:00:00 1970
@@ -1,11 +0,0 @@
-$OpenBSD: patch-tremor_res012_c,v 1.1 2008/03/30 20:39:41 fgsch Exp $
---- tremor/res012.c.orig Sun Oct  7 20:49:27 2007
-+++ tremor/res012.c Sun Mar 30 22:26:40 2008
-@@ -25,6 +25,7 @@
- #include "codebook.h"
- #include "misc.h"
- #include "os.h"
-+#include "block.h"
-
- typedef struct {
-   vorbis_info_residue0 *info;
diff -urNa mplayer/patches/patch-tremor_synthesis_c mplayer.new/patches/patch-tremor_synthesis_c
--- mplayer/patches/patch-tremor_synthesis_c Wed Jul  8 20:14:05 2009
+++ mplayer.new/patches/patch-tremor_synthesis_c Thu Jan  1 01:00:00 1970
@@ -1,11 +0,0 @@
-$OpenBSD: patch-tremor_synthesis_c,v 1.1 2008/03/30 20:39:41 fgsch Exp $
---- tremor/synthesis.c.orig Sun Oct  7 20:49:27 2007
-+++ tremor/synthesis.c Sun Mar 30 22:26:40 2008
-@@ -23,6 +23,7 @@
- #include "registry.h"
- #include "misc.h"
- #include "os.h"
-+#include "block.h"
-
- int vorbis_synthesis(vorbis_block *vb,ogg_packet *op){
-   vorbis_dsp_state     *vd=vb->vd;

 « Return to Thread: mplayer update effort