On Wed, Mar 16, 2011 at 01:13:01PM +0000, Edd Barrett wrote: > On Wed, Mar 16, 2011 at 12:55:27PM +0000, Stuart Henderson wrote: > > Build dependencies that are not the default package or > > install target will be processed in a subdirectory of the > > working directory, specifically, in ${WRKDIR}/directory. > > ^ sweet!
Works like a beauty. Cheers for the pointer. Index: Makefile =================================================================== RCS file: /cvs/ports/x11/mplayer/Makefile,v retrieving revision 1.181 diff -u -p -u -r1.181 Makefile --- Makefile 12 Feb 2011 10:49:36 -0000 1.181 +++ Makefile 16 Mar 2011 17:08:21 -0000 @@ -5,19 +5,18 @@ ONLY_FOR_ARCHS = alpha amd64 arm i386 mi COMMENT = movie player supporting many formats -V = 20101024 -V_DASHED = 2010-10-24 +V = 20110309 +FFMPEG_V = 20110306 SUBST_VARS += PREFIX CONFDIR +# Distfiles must be hand-rolled, see README N = mplayer -DISTNAME = mplayer-export-snapshot-${V} +DISTNAME = mplayer-${V} + +DISTFILES = ${DISTNAME}${EXTRACT_SUFX} PKGNAME = ${N}-${V} -REVISION = 2 CATEGORIES = x11 multimedia -EXTRACT_SUFX = .tar.bz2 - -WRKDIST = ${WRKDIR}/mplayer-export-${V_DASHED} HOMEPAGE = http://www.mplayerhq.hu/ @@ -27,11 +26,11 @@ PERMIT_PACKAGE_FTP = Yes PERMIT_DISTFILES_CDROM = Yes PERMIT_DISTFILES_FTP = Yes -WANTLIB = bz2 c cdda_interface cdda_paranoia crypto \ - dv dvdnavmini dvdread faac faad fribidi jpeg lcms \ - m mng mp3lame mpcdec ncurses ogg>=5 orc-0.4 png \ +WANTLIB = avcodec avformat avutil bz2 c cdda_interface cdda_paranoia \ + crypto dv faac fribidi gsm jpeg lcms \ + m mng mp3lame ncurses ogg>=5 orc-0.4 png postproc \ pthread schroedinger-1.0>=2.0 sndio speex stdc++ \ - theora ungif util vpx x264>=5 xvidcore z + swscale theora ungif util x264>=5 xvidcore z # we use a snapshot MASTER_SITES = http://theunixzoo.co.uk/distfiles/ @@ -43,6 +42,7 @@ MODULES += converters/libiconv LIB_DEPENDS = graphics/png \ graphics/jpeg \ graphics/libungif \ + graphics/ffmpeg>=20110306 \ audio/cdparanoia>=3.a9.8 \ multimedia/libtheora \ audio/speex \ @@ -58,10 +58,8 @@ LIB_DEPENDS = graphics/png \ graphics/libmng \ archivers/bzip2 \ multimedia/schroedinger>=1.0.10 \ - audio/faad \ audio/faac \ - multimedia/x264>=20101023 \ - multimedia/libvpx + multimedia/x264>=20101023 BUILD_DEPENDS = net/livemedia \ audio/rtunes>=0.8 \ @@ -70,6 +68,10 @@ BUILD_DEPENDS = net/livemedia \ textproc/docbook \ textproc/docbook-xsl \ audio/ladspa +# To do dynamic ffmpeg linking, you also need the ffmpeg sources inside +# the build tree for some obscure reason. This should retrieve the same +# distfile as graphics/ffmpeg. +BUILD_DEPENDS +=graphics/ffmpeg:patch .if ${MACHINE_ARCH:Mamd64} || ${MACHINE_ARCH:Mi386} BUILD_DEPENDS += devel/yasm @@ -98,11 +100,14 @@ CONFIGURE_ARGS += --disable-alsa \ --disable-vidix \ --disable-select \ --disable-libcdio \ - --disable-dvdread-internal \ - --disable-libdvdcss-internal \ - --disable-faad-internal +# seems stable dvdnav does not work with a new mplayer. +# if they make a release in the future, maybe we can pull that in, +# but for now we have to use the internal one. +# --disable-dvdread-internal \ +# --disable-libdvdcss-internal \ # gui is not supported anymore and we have better ones in ports -CONFIGURE_ARGS += --disable-gui +CONFIGURE_ARGS += --disable-gui \ + --disable-ffmpeg_a # link ffmpeg .so (graphics/ffmpeg) # CONFIGURE_ARGS that enable internal stuff CONFIGURE_ARGS += --enable-menu @@ -122,7 +127,8 @@ CONFIGURE_ARGS += --disable-smb \ --disable-ggi \ --disable-libopenjpeg \ --disable-mpg123 \ - --disable-librtmp + --disable-librtmp \ + --disable-faad # internal tremor, external tremor, external libvorbis all conflict # we choose libvorbis to enable encoding to vorbis @@ -220,17 +226,15 @@ post-extract: pre-configure: ${SUBST_CMD} ${WRKSRC}/DOCS/xml/configure - -# Put a version.h in place so svn is not a BUILD_DEPEND -# (see version.sh for how this was supposed to work). -post-configure: - cp ${FILESDIR}/version.h ${WRKDIST}/version.h - post-build: @cd ${WRKSRC}/DOCS/xml && ${MAKE_PROGRAM} DOCDIR = ${PREFIX}/share/doc/mplayer EXAMPLEDIR = ${PREFIX}/share/examples/mplayer + +# link ffmpeg sources to where build expects +pre-patch: + ln -s ${WRKDIR}/graphics/ffmpeg/ffmpeg-git-${FFMPEG_V} ${WRKSRC}/ffmpeg # install docs post-install: Index: README =================================================================== RCS file: README diff -N README --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ README 16 Mar 2011 17:08:21 -0000 @@ -0,0 +1,64 @@ +$OpenBSD$ + +Porting notes for MPlayer +========================= + +In addition to the comments in Makefile, porters should also read these +notes: + +FFMPEG Linkage +-------------- + +We link the shared libraries from the graphics/ffmpeg port. This is what +--disable-ffmpeg_a does, however we still need the ffmpeg sources in the +build dir for this to work. We fetch and extract the distfile for the +ffmpeg port at the same time as the actual mplayer distfile and put it +in place. + +Ensure that ffmpeg was dynamically linked by using ldd on the mplayer +binary and searching for one of the ffmpeg libs in the listing (eg. +libavcodec). + +Selecting Codec Implementations +------------------------------- + +As a general rule, we prefer to use FFMPEG implementations, but only if +they are good quality. If this is the case, try not to pull in external +codec libraries for the same codec. + +There is an exception to this rule, which is where an external library +provides an encoder and decoder, and there is a decoder for the given +codec in FFMPEG, but no encoder; in such a case, go ahead and link the +external library so that users can encode with mencoder. + +Be aware that some hardware lacks a floating point unit (ARM for +example). On these architectures, you should select integer decoders +where possible. Eg. Tremor instead of Vorbis. + +FFMPEG OGG Demuxer Bug +---------------------- + +The pkg/README details a bug in the FFMPEG Ogg demuxer; You can test the +existence of this bug with this URL: +http://icecast.version6.net:8888/okul.ogg + +When a song ends, mplayer will stall saying it cannot fill the cache. + +Rolling a Distfile +------------------ + +svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer-YYYYMMDD +cd mplayer-YYYYMMDD +./version.sh (this should create a version.h) +find . -name '.svn' | xargs rm -Rf +cd .. +tar zcvf mplayer-YYYYMMDD.tar.gz mplayer-YYYYMMDD + +Testing Mencoder +---------------- + +See here to know what you can contain it what: +http://en.wikipedia.org/wiki/Comparison_of_container_formats + +Make a h264/mp4 (although lavc containers are somewhat broken in mencoder): +mencoder -ovc x264 -of lavf -lavfopts format=mp4 -nosound -o out.mp4 <infile> Index: distinfo =================================================================== RCS file: /cvs/ports/x11/mplayer/distinfo,v retrieving revision 1.34 diff -u -p -u -r1.34 distinfo --- distinfo 8 Nov 2010 21:25:44 -0000 1.34 +++ distinfo 16 Mar 2011 17:08:21 -0000 @@ -1,5 +1,10 @@ -MD5 (mplayer-export-snapshot-20101024.tar.bz2) = F797FlNAF1eu01Goo2VXNw== -RMD160 (mplayer-export-snapshot-20101024.tar.bz2) = S9533qXXp0k7Y5TXnXHbk4yfRBs= -SHA1 (mplayer-export-snapshot-20101024.tar.bz2) = iGBuBIpI6dKVOxdmJ4HKyatTHUM= -SHA256 (mplayer-export-snapshot-20101024.tar.bz2) = BbFJxSzFbQ2CpHSGr0b5UAGLJ0wu8VqHCMvBsvy5uJE= -SIZE (mplayer-export-snapshot-20101024.tar.bz2) = 9998106 +MD5 (ffmpeg-git-20110306.tar.gz) = sfTm9NP2uKSM6gBhiuAfoA== +MD5 (mplayer-20110309.tar.gz) = EU2sXltwhr4VhUplf8qsXw== +RMD160 (ffmpeg-git-20110306.tar.gz) = ec7bfWXTeMQKDoHSTmnDQWZ/0Pk= +RMD160 (mplayer-20110309.tar.gz) = QlDlgZxUyawqSdBWC871ys/QoRA= +SHA1 (ffmpeg-git-20110306.tar.gz) = s6wHaPwZFMZRaaT+/LP+HiNaSCk= +SHA1 (mplayer-20110309.tar.gz) = AMaoe0ip6hI2EyYdtOf6uHgcgio= +SHA256 (ffmpeg-git-20110306.tar.gz) = Av5pUZYm1q+shteP/tHYeHgF98bB3whT20zIyq1x5L8= +SHA256 (mplayer-20110309.tar.gz) = yeswxU3WOlLg5FnCJQJL5hLLopvSp543ovqjPN4FGSI= +SIZE (ffmpeg-git-20110306.tar.gz) = 4865660 +SIZE (mplayer-20110309.tar.gz) = 6874760 Index: files/version.h =================================================================== RCS file: files/version.h diff -N files/version.h --- files/version.h 8 Nov 2010 21:25:44 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,2 +0,0 @@ -#define VERSION "SVN-r32528" -#define MP_TITLE "%s "VERSION"-OpenBSD (C) 2000-2010 MPlayer Team\n" Index: patches/patch-DOCS_man_en_mplayer_1 =================================================================== RCS file: /cvs/ports/x11/mplayer/patches/patch-DOCS_man_en_mplayer_1,v retrieving revision 1.4 diff -u -p -u -r1.4 patch-DOCS_man_en_mplayer_1 --- patches/patch-DOCS_man_en_mplayer_1 8 Nov 2010 21:25:44 -0000 1.4 +++ patches/patch-DOCS_man_en_mplayer_1 16 Mar 2011 17:08:21 -0000 @@ -1,7 +1,7 @@ $OpenBSD: patch-DOCS_man_en_mplayer_1,v 1.4 2010/11/08 21:25:44 edd Exp $ ---- DOCS/man/en/mplayer.1.orig Sat Oct 23 22:09:45 2010 -+++ DOCS/man/en/mplayer.1 Sun Oct 24 10:36:58 2010 -@@ -1390,7 +1390,7 @@ May be negative. +--- DOCS/man/en/mplayer.1.orig Wed Mar 9 00:32:59 2011 ++++ DOCS/man/en/mplayer.1 Wed Mar 9 00:45:10 2011 +@@ -1366,7 +1366,7 @@ May be negative. . .TP .B \-cdrom\-device <path to device> @@ -10,7 +10,7 @@ $OpenBSD: patch-DOCS_man_en_mplayer_1,v . .TP .B \-channels <number> (also see \-af channels) -@@ -11821,11 +11821,11 @@ mplayer \-vo zr2 \-vf scale=352:288,zrmjpeg file.avi +@@ -11877,11 +11877,11 @@ mplayer \-vo zr2 \-vf scale=352:288,zrmjpeg file.avi .PP .B Play DTS-CD with passthrough: .nf Index: patches/patch-Makefile =================================================================== RCS file: /cvs/ports/x11/mplayer/patches/patch-Makefile,v retrieving revision 1.21 diff -u -p -u -r1.21 patch-Makefile --- patches/patch-Makefile 8 Nov 2010 21:25:44 -0000 1.21 +++ patches/patch-Makefile 16 Mar 2011 17:08:21 -0000 @@ -1,15 +1,15 @@ $OpenBSD: patch-Makefile,v 1.21 2010/11/08 21:25:44 edd Exp $ ---- Makefile.orig Fri Oct 22 21:39:43 2010 -+++ Makefile Sun Oct 24 10:38:28 2010 +--- Makefile.orig Thu Mar 3 12:35:16 2011 ++++ Makefile Thu Mar 3 13:22:00 2011 @@ -26,6 +26,7 @@ include config.mak SRCS_AUDIO_INPUT-$(ALSA1X) += stream/ai_alsa1x.c SRCS_AUDIO_INPUT-$(ALSA9) += stream/ai_alsa.c SRCS_AUDIO_INPUT-$(OSS) += stream/ai_oss.c +SRCS_AUDIO_INPUT-$(SNDIO) += stream/ai_sndio.c SRCS_COMMON-$(AUDIO_INPUT) += $(SRCS_AUDIO_INPUT-yes) - SRCS_COMMON-$(BITMAP_FONT) += libvo/font_load.c + SRCS_COMMON-$(BITMAP_FONT) += sub/font_load.c SRCS_COMMON-$(CDDA) += stream/stream_cdda.c \ -@@ -623,6 +624,7 @@ SRCS_MPLAYER-$(S3FB) += libvo/vo_s3fb.c +@@ -585,6 +586,7 @@ SRCS_MPLAYER-$(S3FB) += libvo/vo_s3fb.c SRCS_MPLAYER-$(SDL) += libao2/ao_sdl.c libvo/vo_sdl.c libvo/sdl_common.c SRCS_MPLAYER-$(SGIAUDIO) += libao2/ao_sgi.c SRCS_MPLAYER-$(SUNAUDIO) += libao2/ao_sun.c @@ -17,17 +17,17 @@ $OpenBSD: patch-Makefile,v 1.21 2010/11/ SRCS_MPLAYER-$(SVGA) += libvo/vo_svga.c SRCS_MPLAYER-$(TDFXFB) += libvo/vo_tdfxfb.c SRCS_MPLAYER-$(TDFXVID) += libvo/vo_tdfx_vid.c -@@ -686,7 +688,8 @@ SRCS_MPLAYER = command.c \ - libvo/video_out.c \ +@@ -648,7 +650,8 @@ SRCS_MPLAYER = command.c \ libvo/vo_mpegpes.c \ libvo/vo_null.c \ + sub/spuenc.c \ - $(SRCS_MPLAYER-yes) + $(SRCS_MPLAYER-yes) \ -+ libao2/ao_rtunes.c ++ libao2/ao_rtunes.c SRCS_MENCODER-$(FAAC) += libmpcodecs/ae_faac.c -@@ -906,7 +909,16 @@ loader/%: CFLAGS += -fno-omit-frame-pointer $(CFLAGS_N +@@ -864,7 +867,16 @@ loader/%: CFLAGS += -fno-omit-frame-pointer $(CFLAGS_N #loader/%: CFLAGS += -Ddbg_printf=__vprintf -DTRACE=__vprintf -DDETAILED_OUT loader/win32%: CFLAGS += $(CFLAGS_STACKREALIGN) Index: patches/patch-command_c =================================================================== RCS file: /cvs/ports/x11/mplayer/patches/patch-command_c,v retrieving revision 1.3 diff -u -p -u -r1.3 patch-command_c --- patches/patch-command_c 8 Nov 2010 21:25:44 -0000 1.3 +++ patches/patch-command_c 16 Mar 2011 17:08:21 -0000 @@ -1,7 +1,7 @@ $OpenBSD: patch-command_c,v 1.3 2010/11/08 21:25:44 edd Exp $ ---- command.c.orig Sun Oct 24 11:11:25 2010 -+++ command.c Sun Oct 24 11:11:43 2010 -@@ -3379,7 +3379,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd) +--- command.c.orig Thu Jan 27 20:51:11 2011 ++++ command.c Mon Jan 31 14:18:31 2011 +@@ -3375,7 +3375,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd) case MP_CMD_RUN: #ifndef __MINGW32__ if (!fork()) { Index: patches/patch-configure =================================================================== RCS file: /cvs/ports/x11/mplayer/patches/patch-configure,v retrieving revision 1.57 diff -u -p -u -r1.57 patch-configure --- patches/patch-configure 8 Nov 2010 21:25:44 -0000 1.57 +++ patches/patch-configure 16 Mar 2011 17:08:21 -0000 @@ -1,7 +1,62 @@ $OpenBSD: patch-configure,v 1.57 2010/11/08 21:25:44 edd Exp $ ---- configure.orig Thu Oct 21 10:35:56 2010 -+++ configure Sat Nov 6 13:41:02 2010 -@@ -461,6 +461,7 @@ Audio output: +--- configure.orig Wed Mar 9 00:33:03 2011 ++++ configure Wed Mar 9 00:46:58 2011 +@@ -35,29 +35,33 @@ + # + ############################################################################# + +-if test -e ffmpeg/.svn ; then +- echo "You have an outdated FFmpeg SVN checkout in ffmpeg/, please (re)move or replace it" +- exit 1 +-fi + +-if test -e ffmpeg/mp_auto_pull ; then +- if ! (cd ffmpeg && git pull --rebase --ff-only) ; then +- echo "git pull failed, (re)move ffmpeg/mp_auto_pull to disable pulling" +- exit 1 +- fi +-fi ++# OpenBSD ++# Don't do anything funky with git or svn, we will provide mplayer with ffmpeg ++# ++#if test -e ffmpeg/.svn ; then ++# echo "You have an outdated FFmpeg SVN checkout in ffmpeg/, please (re)move or replace it" ++# exit 1 ++#fi ++# ++#if test -e ffmpeg/mp_auto_pull ; then ++# if ! (cd ffmpeg && git pull --rebase --ff-only) ; then ++# echo "git pull failed, (re)move ffmpeg/mp_auto_pull to disable pulling" ++# exit 1 ++# fi ++#fi ++# ++#if ! test -e ffmpeg ; then ++# echo "No FFmpeg checkout, press enter to download one with git or CTRL+C to abort" ++# read tmp ++# if ! git clone --depth 1 git://git.videolan.org/ffmpeg.git ffmpeg ; then ++# rm -rf ffmpeg ++# echo "Failed to get a FFmpeg checkout" ++# exit 1 ++# fi ++# touch ffmpeg/mp_auto_pull ++#fi + +-if ! test -e ffmpeg ; then +- echo "No FFmpeg checkout, press enter to download one with git or CTRL+C to abort" +- read tmp +- if ! git clone --depth 1 git://git.videolan.org/ffmpeg.git ffmpeg ; then +- rm -rf ffmpeg +- echo "Failed to get a FFmpeg checkout" +- exit 1 +- fi +- touch ffmpeg/mp_auto_pull +-fi +- + # Prevent locale nonsense from breaking basic text processing utils + export LC_ALL=C + +@@ -510,6 +514,7 @@ Audio output: --disable-nas disable NAS audio output [autodetect] --disable-sgiaudio disable SGI audio output [autodetect] --disable-sunaudio disable Sun audio output [autodetect] @@ -9,7 +64,7 @@ $OpenBSD: patch-configure,v 1.57 2010/11 --disable-kai disable KAI audio output [autodetect] --disable-dart disable DART audio output [autodetect] --disable-win32waveout disable Windows waveout audio output [autodetect] -@@ -698,6 +699,7 @@ _xf86keysym=auto +@@ -745,6 +750,7 @@ _xf86keysym=auto _mlib=no #broken, thus disabled _sgiaudio=auto _sunaudio=auto @@ -17,7 +72,7 @@ $OpenBSD: patch-configure,v 1.57 2010/11 _alsa=auto _fastmemcpy=yes hardcoded_tables=no -@@ -1126,6 +1128,8 @@ for ac_option do +@@ -1169,6 +1175,8 @@ for ac_option do --disable-mlib) _mlib=no ;; --enable-sunaudio) _sunaudio=yes ;; --disable-sunaudio) _sunaudio=no ;; @@ -26,7 +81,7 @@ $OpenBSD: patch-configure,v 1.57 2010/11 --enable-sgiaudio) _sgiaudio=yes ;; --disable-sgiaudio) _sgiaudio=no ;; --enable-alsa) _alsa=yes ;; -@@ -1446,7 +1450,7 @@ if test -z "$_target" ; then +@@ -1489,7 +1497,7 @@ if test -z "$_target" ; then sh3|sh4|sh4a) host_arch=sh ;; s390) host_arch=s390 ;; s390x) host_arch=s390x ;; @@ -35,7 +90,7 @@ $OpenBSD: patch-configure,v 1.57 2010/11 vax) host_arch=vax ;; xtensa*) host_arch=xtensa ;; *) host_arch=UNKNOWN ;; -@@ -2157,7 +2161,7 @@ case "$host_arch" in +@@ -2200,7 +2208,7 @@ case "$host_arch" in arch='sparc' iproc='sparc' if test "$host_arch" = "sparc64" ; then @@ -44,7 +99,7 @@ $OpenBSD: patch-configure,v 1.57 2010/11 proc='ultrasparc' def_fast_64bit='#define HAVE_FAST_64BIT 1' elif sunos ; then -@@ -2476,7 +2480,7 @@ cat > $TMPC << EOF +@@ -2519,7 +2527,7 @@ cat > $TMPC << EOF int ff_extern; EOF cc_check -c || die "Symbol mangling check failed." @@ -53,7 +108,7 @@ $OpenBSD: patch-configure,v 1.57 2010/11 extern_prefix=${sym%%ff_extern*} def_extern_asm="#define EXTERN_ASM $extern_prefix" def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\"" -@@ -2535,7 +2539,7 @@ elif test -z "$CFLAGS" ; then +@@ -2578,7 +2586,7 @@ elif test -z "$CFLAGS" ; then elif test "$cc_vendor" != "gnu" ; then CFLAGS="-O2 $_march $_mcpu $_pipe" else @@ -62,7 +117,7 @@ $OpenBSD: patch-configure,v 1.57 2010/11 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls" extra_ldflags="$extra_ldflags -ffast-math" fi -@@ -2817,8 +2821,11 @@ echores "$ibm_asm" +@@ -2860,8 +2868,11 @@ echores "$ibm_asm" def_gnu_as='#define HAVE_GNU_AS 0' gnu_as=no echocheck "GNU assembler" @@ -76,7 +131,7 @@ $OpenBSD: patch-configure,v 1.57 2010/11 echores "$gnu_as" fi -@@ -3436,7 +3443,8 @@ if test "$_memalign" = yes ; then +@@ -3480,7 +3491,8 @@ if test "$_memalign" = yes ; then else def_memalign='#define HAVE_MEMALIGN 0' def_map_memalign='#define memalign(a, b) malloc(b)' @@ -86,7 +141,7 @@ $OpenBSD: patch-configure,v 1.57 2010/11 fi echores "$_memalign" -@@ -3543,7 +3551,7 @@ int main(void) { pthread_t tid; return pthread_create( +@@ -3585,7 +3597,7 @@ int main(void) { pthread_t tid; return pthread_create( EOF _pthreads=no if ! hpux ; then @@ -95,7 +150,7 @@ $OpenBSD: patch-configure,v 1.57 2010/11 # for crosscompilation, we cannot execute the program, be happy if we can link statically cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break done -@@ -4664,6 +4672,8 @@ if test "$_aa" = yes ; then +@@ -4661,6 +4673,8 @@ if test "$_aa" = yes ; then def_aa='#define CONFIG_AA 1' if cygwin ; then libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)" @@ -104,24 +159,31 @@ $OpenBSD: patch-configure,v 1.57 2010/11 fi vomodules="aa $vomodules" else -@@ -4873,14 +4883,14 @@ int main(void) { - return !p_ver || p_ver[0] == 0; - } - EOF -- if cc_check -lmng -lz $_ld_lm ; then -+ if cc_check -lmng -llcms -ljpeg -lz -lm $_ld_lm ; then - _mng=yes - fi +@@ -4846,7 +4860,7 @@ fi + echores "$_png" + if test "$_png" = yes ; then + def_png='#define CONFIG_PNG 1' +- extra_ldflags="$extra_ldflags -lpng -lz" ++ extra_ldflags="$extra_ldflags -lpng -lz -lm" + else + def_png='#undef CONFIG_PNG' + fi +@@ -4854,12 +4868,12 @@ fi + echocheck "MNG support" + if test "$_mng" = auto ; then + _mng=no +- return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng=yes ++ return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -llcms -ljpeg -lmng -lz $_ld_lm && _mng=yes fi echores "$_mng" if test "$_mng" = yes ; then def_mng='#define CONFIG_MNG 1' - extra_ldflags="$extra_ldflags -lmng -lz" -+ extra_ldflags="$extra_ldflags -lmng -llcms -ljpeg -lz -lm" ++ extra_ldflags="$extra_ldflags -lmng -llcms -lz -ljpeg $_ld_m" else def_mng='#undef CONFIG_MNG' fi -@@ -5691,6 +5701,26 @@ fi +@@ -5663,6 +5677,26 @@ fi echores "$_sunaudio" @@ -148,7 +210,7 @@ $OpenBSD: patch-configure,v 1.57 2010/11 def_mlib='#define CONFIG_MLIB 0' if sunos; then echocheck "Sun mediaLib" -@@ -5860,8 +5890,9 @@ if test "$_dvdread_internal" = auto ; then +@@ -5832,8 +5866,9 @@ if test "$_dvdread_internal" = auto ; then elif test "$_dvdread" = auto ; then _dvdread=no if test "$_dl" = yes; then @@ -160,16 +222,7 @@ $OpenBSD: patch-configure,v 1.57 2010/11 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then _dvdread=yes extra_cflags="$extra_cflags $_dvdreadcflags" -@@ -6347,7 +6378,7 @@ elif test "$_libvorbis" = yes ; then - def_vorbis='#define CONFIG_OGGVORBIS 1' - codecmodules="libvorbis $codecmodules" - res_comment="libvorbis" -- extra_ldflags="$extra_ldflags -lvorbis -logg" -+ extra_ldflags="$extra_ldflags -lvorbisenc -lvorbis -logg" - libavencoders="$libavencoders LIBVORBIS_ENCODER" - else - _vorbis=no -@@ -6547,7 +6578,7 @@ echores "$_libmpeg2" +@@ -6521,7 +6556,7 @@ echores "$_libmpeg2" echocheck "libdca support" if test "$_libdca" = auto ; then _libdca=no @@ -178,16 +231,16 @@ $OpenBSD: patch-configure,v 1.57 2010/11 statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm && extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break done -@@ -7448,6 +7479,8 @@ if test "$_tv_v4l2" = auto ; then +@@ -7360,6 +7395,8 @@ if test "$_tv_v4l2" = auto ; then _tv_v4l2=no if test "$_tv" = yes && linux ; then - header_check linux/videodev2.h && _tv_v4l2=yes + header_check_broken sys/time.h linux/videodev2.h && _tv_v4l2=yes + elif test "$_tv" = yes && openbsd ; then + header_check sys/videoio.h && _tv_v4l2=yes fi fi if test "$_tv_v4l2" = yes ; then -@@ -8158,6 +8191,7 @@ SPEEX = $_speex +@@ -8069,6 +8106,7 @@ SPEEX = $_speex STREAM_CACHE = $_stream_cache SGIAUDIO = $_sgiaudio SUNAUDIO = $_sunaudio @@ -195,7 +248,7 @@ $OpenBSD: patch-configure,v 1.57 2010/11 SVGA = $_svga TDFXFB = $_tdfxfb TDFXVID = $_tdfxvid -@@ -8540,6 +8574,7 @@ $def_ossaudio_devmixer +@@ -8445,6 +8483,7 @@ $def_ossaudio_devmixer $def_pulse $def_sgiaudio $def_sunaudio Index: patches/patch-ffmpeg_libavcodec_Makefile =================================================================== RCS file: patches/patch-ffmpeg_libavcodec_Makefile diff -N patches/patch-ffmpeg_libavcodec_Makefile --- patches/patch-ffmpeg_libavcodec_Makefile 8 Nov 2010 21:25:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,35 +0,0 @@ -$OpenBSD: patch-ffmpeg_libavcodec_Makefile,v 1.1 2010/11/08 21:25:44 edd Exp $ ---- ffmpeg/libavcodec/Makefile.orig Sat Oct 2 10:51:26 2010 -+++ ffmpeg/libavcodec/Makefile Sun Oct 24 13:08:08 2010 -@@ -692,3 +692,31 @@ $(SUBDIR)motionpixels.o: $(SUBDIR)motionpixels_tables. - $(SUBDIR)pcm.o: $(SUBDIR)pcm_tables.h - $(SUBDIR)qdm2.o: $(SUBDIR)qdm2_tables.h - endif -+ -+ifdef ARCH_X86_32 -+ifeq (,$(findstring -O,$(CFLAGS))) -+x86/dsputil_mmx.o: CFLAGS += -O -+x86/flacdsp_mmx.o: CFLAGS += -O -+x86/fft_3dn.o: CFLAGS += -O -+x86/fft_3dn2.o: CFLAGS += -O -+x86/mlpdsp.o: CFLAGS += -O -+x86/snowdsp_mmx.o: CFLAGS += -O -+h264.o: CFLAGS += -O -+h264_cabac.o: CFLAGS += -O -+h264_parser.o: CFLAGS += -O -+cabac.o: CFLAGS += -O -+endif -+# OpenBSD -- otherwise we run out of registers, eg: -+# "cabac.h:527: error: can't find a register in class..." -+x86/dsputil_mmx.o: CFLAGS += -fomit-frame-pointer -+x86/flacdsp_mmx.o: CFLAGS += -fomit-frame-pointer -+x86/fft_3dn.o: CFLAGS += -fomit-frame-pointer -+x86/fft_3dn2.o: CFLAGS += -fomit-frame-pointer -+x86/mlpdsp.o: CFLAGS += -fomit-frame-pointer -+x86/snowdsp_mmx.o: CFLAGS += -fomit-frame-pointer -+h264.o: CFLAGS += -fomit-frame-pointer -+h264_cabac.o: CFLAGS += -fomit-frame-pointer -+h264_parser.o: CFLAGS += -fomit-frame-pointer -+cabac.o: CFLAGS += -fomit-frame-pointer -+endif -+ Index: patches/patch-ffmpeg_libavcodec_vorbis_dec_c =================================================================== RCS file: patches/patch-ffmpeg_libavcodec_vorbis_dec_c diff -N patches/patch-ffmpeg_libavcodec_vorbis_dec_c --- patches/patch-ffmpeg_libavcodec_vorbis_dec_c 12 Feb 2011 10:49:37 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,126 +0,0 @@ -$OpenBSD: patch-ffmpeg_libavcodec_vorbis_dec_c,v 1.1 2011/02/12 10:49:37 jasper Exp $ - -Security fixes for CVE-2010-4704, CVE-2010-4705 and CVE-2011-0480. -From upstream git commits: - 3dde66752d59dfdd0f3727efd66e7202b3c75078 - 366d919016a679d3955f6fe5278fa7ce4f47b81e - 13184036a6b1b1d4b61c91118c0896e9ad4634c3 - 925aa96915b8143017cb63418cb709b992c59065 - ---- ffmpeg/libavcodec/vorbis_dec.c.orig Tue Aug 31 00:34:09 2010 -+++ ffmpeg/libavcodec/vorbis_dec.c Thu Feb 10 18:26:28 2011 -@@ -61,8 +61,8 @@ typedef struct vorbis_floor0_s vorbis_floor0; - typedef struct vorbis_floor1_s vorbis_floor1; - struct vorbis_context_s; - typedef --uint_fast8_t (* vorbis_floor_decode_func) -- (struct vorbis_context_s *, vorbis_floor_data *, float *); -+int (* vorbis_floor_decode_func) -+ (struct vorbis_context_s *, vorbis_floor_data *, float *); - typedef struct { - uint_fast8_t floor_type; - vorbis_floor_decode_func decode; -@@ -459,11 +459,11 @@ static int vorbis_parse_setup_hdr_tdtransforms(vorbis_ - - // Process floors part - --static uint_fast8_t vorbis_floor0_decode(vorbis_context *vc, -- vorbis_floor_data *vfu, float *vec); -+static int vorbis_floor0_decode(vorbis_context *vc, -+ vorbis_floor_data *vfu, float *vec); - static void create_map(vorbis_context *vc, uint_fast8_t floor_number); --static uint_fast8_t vorbis_floor1_decode(vorbis_context *vc, -- vorbis_floor_data *vfu, float *vec); -+static int vorbis_floor1_decode(vorbis_context *vc, -+ vorbis_floor_data *vfu, float *vec); - static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) - { - GetBitContext *gb = &vc->gb; -@@ -483,6 +483,7 @@ static int vorbis_parse_setup_hdr_floors(vorbis_contex - if (floor_setup->floor_type == 1) { - int maximum_class = -1; - uint_fast8_t rangebits; -+ uint_fast32_t rangemax; - uint_fast16_t floor1_values = 2; - - floor_setup->decode = vorbis_floor1_decode; -@@ -534,8 +535,15 @@ static int vorbis_parse_setup_hdr_floors(vorbis_contex - - - rangebits = get_bits(gb, 4); -+ rangemax = (1 << rangebits); -+ if (rangemax > vc->blocksize[1] / 2) { -+ av_log(vc->avccontext, AV_LOG_ERROR, -+ "Floor value is too large for blocksize: %d (%d)\n", -+ rangemax, vc->blocksize[1] / 2); -+ return -1; -+ } - floor_setup->data.t1.list[0].x = 0; -- floor_setup->data.t1.list[1].x = (1 << rangebits); -+ floor_setup->data.t1.list[1].x = rangemax; - - for (j = 0; j < floor_setup->data.t1.partitions; ++j) { - for (k = 0; k < floor_setup->data.t1.class_dimensions[floor_setup->data.t1.partition_class[j]]; ++k, ++floor1_values) { -@@ -653,7 +661,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_cont - res_setup->partition_size = get_bits(gb, 24) + 1; - /* Validations to prevent a buffer overflow later. */ - if (res_setup->begin>res_setup->end || -- res_setup->end > vc->avccontext->channels * vc->blocksize[1] / (res_setup->type == 2 ? 1 : 2) || -+ res_setup->end > vc->avccontext->channels * vc->blocksize[1] / 2 || - (res_setup->end-res_setup->begin) / res_setup->partition_size > V_MAX_PARTITIONS) { - av_log(vc->avccontext, AV_LOG_ERROR, "partition out of bounds: type, begin, end, size, blocksize: %"PRIdFAST16", %"PRIdFAST32", %"PRIdFAST32", %u, %"PRIdFAST32"\n", res_setup->type, res_setup->begin, res_setup->end, res_setup->partition_size, vc->blocksize[1] / 2); - return -1; -@@ -1015,8 +1023,8 @@ static av_cold int vorbis_decode_init(AVCodecContext * - - // Read and decode floor - --static uint_fast8_t vorbis_floor0_decode(vorbis_context *vc, -- vorbis_floor_data *vfu, float *vec) -+static int vorbis_floor0_decode(vorbis_context *vc, -+ vorbis_floor_data *vfu, float *vec) - { - vorbis_floor0 *vf = &vfu->t0; - float *lsp = vf->lsp; -@@ -1040,6 +1048,9 @@ static uint_fast8_t vorbis_floor0_decode(vorbis_contex - } - AV_DEBUG("floor0 dec: booknumber: %u\n", book_idx); - codebook = vc->codebooks[vf->book_list[book_idx]]; -+ /* Invalid codebook! */ -+ if (!codebook.codevectors) -+ return -1; - - while (lsp_len<vf->order) { - int vec_off; -@@ -1125,8 +1136,8 @@ static uint_fast8_t vorbis_floor0_decode(vorbis_contex - return 0; - } - --static uint_fast8_t vorbis_floor1_decode(vorbis_context *vc, -- vorbis_floor_data *vfu, float *vec) -+static int vorbis_floor1_decode(vorbis_context *vc, -+ vorbis_floor_data *vfu, float *vec) - { - vorbis_floor1 *vf = &vfu->t1; - GetBitContext *gb = &vc->gb; -@@ -1502,13 +1513,20 @@ static int vorbis_parse_audio_packet(vorbis_context *v - - for (i = 0; i < vc->audio_channels; ++i) { - vorbis_floor *floor; -+ int ret; - if (mapping->submaps > 1) { - floor = &vc->floors[mapping->submap_floor[mapping->mux[i]]]; - } else { - floor = &vc->floors[mapping->submap_floor[0]]; - } - -- no_residue[i] = floor->decode(vc, &floor->data, ch_floor_ptr); -+ ret = floor->decode(vc, &floor->data, ch_floor_ptr); -+ -+ if (ret < 0) { -+ av_log(vc->avccontext, AV_LOG_ERROR, "Invalid codebook in vorbis_floor_decode.\n"); -+ return -1; -+ } -+ no_residue[i] = ret; - ch_floor_ptr += blocksize / 2; - } - Index: patches/patch-ffmpeg_libavcodec_x86_vp56_arith_h =================================================================== RCS file: patches/patch-ffmpeg_libavcodec_x86_vp56_arith_h diff -N patches/patch-ffmpeg_libavcodec_x86_vp56_arith_h --- patches/patch-ffmpeg_libavcodec_x86_vp56_arith_h 8 Nov 2010 21:25:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-ffmpeg_libavcodec_x86_vp56_arith_h,v 1.1 2010/11/08 21:25:44 edd Exp $ ---- ffmpeg/libavcodec/x86/vp56_arith.h.orig Mon Oct 25 23:11:14 2010 -+++ ffmpeg/libavcodec/x86/vp56_arith.h Mon Oct 25 23:12:00 2010 -@@ -24,7 +24,7 @@ - #ifndef AVCODEC_X86_VP56_ARITH_H - #define AVCODEC_X86_VP56_ARITH_H - --#if HAVE_FAST_CMOV -+#if HAVE_FAST_CMOV && !ARCH_X86_64 - #define vp56_rac_get_prob vp56_rac_get_prob - static av_always_inline int vp56_rac_get_prob(VP56RangeCoder *c, uint8_t prob) - { Index: patches/patch-ffmpeg_libavutil_x86_cpu_h =================================================================== RCS file: patches/patch-ffmpeg_libavutil_x86_cpu_h diff -N patches/patch-ffmpeg_libavutil_x86_cpu_h --- patches/patch-ffmpeg_libavutil_x86_cpu_h 8 Nov 2010 21:25:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-ffmpeg_libavutil_x86_cpu_h,v 1.1 2010/11/08 21:25:44 edd Exp $ ---- ffmpeg/libavutil/x86_cpu.h.orig Mon Oct 25 23:02:43 2010 -+++ ffmpeg/libavutil/x86_cpu.h Mon Oct 25 23:03:10 2010 -@@ -71,7 +71,7 @@ typedef int x86_reg; - #define HAVE_7REGS (ARCH_X86_64 || (HAVE_EBX_AVAILABLE && HAVE_EBP_AVAILABLE)) - #define HAVE_6REGS (ARCH_X86_64 || (HAVE_EBX_AVAILABLE || HAVE_EBP_AVAILABLE)) - --#if ARCH_X86_64 && defined(PIC) -+#if ARCH_X86_64 // && defined(PIC) - # define BROKEN_RELOCATIONS 1 - #endif - Index: patches/patch-ffmpeg_libswscale_Makefile =================================================================== RCS file: patches/patch-ffmpeg_libswscale_Makefile diff -N patches/patch-ffmpeg_libswscale_Makefile --- patches/patch-ffmpeg_libswscale_Makefile 8 Nov 2010 21:25:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,16 +0,0 @@ -$OpenBSD: patch-ffmpeg_libswscale_Makefile,v 1.1 2010/11/08 21:25:44 edd Exp $ ---- ffmpeg/libswscale/Makefile.orig Sun Oct 24 13:08:24 2010 -+++ ffmpeg/libswscale/Makefile Sun Oct 24 13:09:41 2010 -@@ -21,3 +21,12 @@ DIRS = bfin mlib ppc sparc x86 - - include $(SUBDIR)../subdir.mak - $(SUBDIR)swscale-test$(EXESUF): ELIBS = -lavcore -+ -+ifdef ARCH_X86_32 -+ifeq (,$(findstring -O,$(CFLAGS))) -+x86/yuv2rgb_mmx.o: CFLAGS += -O -+endif -+# OpenBSD: Again - we run out of registers otherwise -+x86/yuv2rgb_mmx.o: CFLAGS += -fomit-frame-pointer -+endif -+ Index: patches/patch-libmpcodecs_ad_faad_c =================================================================== RCS file: /cvs/ports/x11/mplayer/patches/patch-libmpcodecs_ad_faad_c,v retrieving revision 1.5 diff -u -p -u -r1.5 patch-libmpcodecs_ad_faad_c --- patches/patch-libmpcodecs_ad_faad_c 8 Nov 2010 21:25:44 -0000 1.5 +++ patches/patch-libmpcodecs_ad_faad_c 16 Mar 2011 17:08:21 -0000 @@ -1,7 +1,7 @@ $OpenBSD: patch-libmpcodecs_ad_faad_c,v 1.5 2010/11/08 21:25:44 edd Exp $ ---- libmpcodecs/ad_faad.c.orig Wed Sep 8 18:38:52 2010 -+++ libmpcodecs/ad_faad.c Sun Oct 24 10:39:37 2010 -@@ -84,7 +84,7 @@ static int aac_probe(unsigned char *buffer, int len) +--- libmpcodecs/ad_faad.c.orig Sat Jan 1 14:27:41 2011 ++++ libmpcodecs/ad_faad.c Mon Jan 31 14:18:31 2011 +@@ -79,7 +79,7 @@ static int aac_probe(unsigned char *buffer, int len) static int init(sh_audio_t *sh) { @@ -10,7 +10,7 @@ $OpenBSD: patch-libmpcodecs_ad_faad_c,v unsigned char faac_channels; int faac_init, pos = 0; faac_hdec = faacDecOpen(); -@@ -197,7 +197,7 @@ static int init(sh_audio_t *sh) +@@ -171,7 +171,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! @@ -19,7 +19,7 @@ $OpenBSD: patch-libmpcodecs_ad_faad_c,v // 8 channels is aac channel order #7. sh->channels = faac_channels == 7 ? 8 : faac_channels; if (audio_output_channels <= 2) sh->channels = faac_channels > 1 ? 2 : 1; -@@ -327,7 +327,7 @@ static int decode_audio(sh_audio_t *sh,unsigned char * +@@ -301,7 +301,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", Index: patches/patch-mplayer_c =================================================================== RCS file: /cvs/ports/x11/mplayer/patches/patch-mplayer_c,v retrieving revision 1.10 diff -u -p -u -r1.10 patch-mplayer_c --- patches/patch-mplayer_c 8 Nov 2010 21:25:44 -0000 1.10 +++ patches/patch-mplayer_c 16 Mar 2011 17:08:21 -0000 @@ -1,7 +1,7 @@ $OpenBSD: patch-mplayer_c,v 1.10 2010/11/08 21:25:44 edd Exp $ ---- mplayer.c.orig Sun Oct 24 11:13:11 2010 -+++ mplayer.c Sun Oct 24 11:13:29 2010 -@@ -852,7 +852,7 @@ static void exit_sighandler(int x){ +--- mplayer.c.orig Thu Mar 3 12:35:16 2011 ++++ mplayer.c Thu Mar 3 13:23:39 2011 +@@ -815,7 +815,7 @@ static void exit_sighandler(int x){ char spid[20]; snprintf(spid, sizeof(spid), "%i", getppid()); getch2_disable(); // allow terminal to work properly with gdb Index: patches/patch-unrar_exec_c =================================================================== RCS file: patches/patch-unrar_exec_c diff -N patches/patch-unrar_exec_c --- patches/patch-unrar_exec_c 8 Nov 2010 21:25:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,16 +0,0 @@ -$OpenBSD: patch-unrar_exec_c,v 1.1 2010/11/08 21:25:44 edd Exp $ ---- unrar_exec.c.orig Sun Oct 24 11:15:56 2010 -+++ unrar_exec.c Sun Oct 24 11:16:11 2010 -@@ -66,10 +66,10 @@ static FILE* launch_pipe(pid_t *apid, const char *exec - || open("/dev/null", O_WRONLY) != 2) - _exit(EXIT_FAILURE); - if (action == UNRAR_LIST) -- execl(executable, executable, "v", archive, NULL); -+ execl(executable, executable, "v", archive, (char *) NULL); - else if (action == UNRAR_EXTRACT) - execl(executable, executable, "p", "-inul", "-p-", -- archive,filename,NULL); -+ archive,filename, (char *) NULL); - mp_msg(MSGT_GLOBAL, MSGL_ERR, "UnRAR: Cannot execute %s\n", executable); - _exit(EXIT_FAILURE); - } Index: pkg/README =================================================================== RCS file: /cvs/ports/x11/mplayer/pkg/README,v retrieving revision 1.1 diff -u -p -u -r1.1 README --- pkg/README 8 Nov 2010 21:25:44 -0000 1.1 +++ pkg/README 16 Mar 2011 17:08:21 -0000 @@ -9,6 +9,11 @@ all arches: Mencoder is not expected to do a good job of multiplexing into container formats other than AVI or MPEG. + ffmpeg's ogg demuxer is broken for ogg streams. If mplayer says "cache + not filling" when a song changes, you have been bitten by this bug. + You can try '-demuxer ogg' as a workaround (or try using ogg123 from + the vorbis-tools package). + i386: win32 codecs were disabled in OpenBSD's build, as the open-source codecs are now of decent quality. -- Best Regards Edd Barrett http://www.theunixzoo.co.uk