ports/80356: [Maintainer-update] multimedia/mplayer
Thomas E. Zander
riggs at rrr.de
Tue Apr 26 08:50:18 UTC 2005
>Number: 80356
>Category: ports
>Synopsis: [Maintainer-update] multimedia/mplayer
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Tue Apr 26 08:50:17 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Thomas E. Zander
>Release: FreeBSD 5.3-RELEASE-p10 i386
>Organization:
>Environment:
System: FreeBSD marvin.riggiland.au 5.3-RELEASE-p10 FreeBSD 5.3-RELEASE-p10 #5: Mon Apr 25 13:08:57 CEST 2005 root at marvin.riggiland.au:/usr/obj/usr/src/sys/MARVIN i386
>Description:
This pr updates the mplayer port to the latest developer release, 1.0pre7.
So far, this addresses several issues:
o rtsp vulnerability (http://vuxml.FreeBSD.org/91c606fc-b5d0-11d9-a788-0001020eed82.html)
o up-to-date libavcodec
o native cooperating with gcc-3.4 releases with and without lrintf()
o rtc needs not as much ${REINPLACE_CMD} as before
o 2936852936852295 new codecs or something like that
The following patches have become obsolete and shall be moved to attic:
o extra-patch-gcc34
o patch-libmpcodecs-ve_x264.c
o patch-mplayer.c
>How-To-Repeat:
>Fix:
diff -ruN mplayer-old/Makefile mplayer/Makefile
--- mplayer-old/Makefile Tue Apr 26 09:27:01 2005
+++ mplayer/Makefile Mon Apr 25 21:54:51 2005
@@ -215,6 +215,10 @@
#
# WITH_VORBIS
# default: autodetect
+# If vorbis libs are not available on the system, mplayer includes
+# an internal vorbis codec based on tremor. If the libs are present
+# or this knob is defined, mplayer links to the shared system-wide
+# installation of ogg/vorbis.
#
# WITH_XANIM
# default: autodetect
@@ -259,8 +263,7 @@
# to be installed.
PORTNAME= mplayer
-PORTVERSION= 0.99.6
-PORTREVISION= 3
+PORTVERSION= 0.99.7
CATEGORIES= multimedia audio ipv6
MASTER_SITES= http://www1.mplayerhq.hu/MPlayer/releases/ \
http://www2.mplayerhq.hu/MPlayer/releases/ \
@@ -272,7 +275,7 @@
ftp://ftp.lug.udel.edu/MPlayer/releases/ \
ftp://mirrors.xmission.com/MPlayer/releases/ \
http://www.rrr.de/~riggs/mplayer/
-DISTNAME= MPlayer-1.0pre6a
+DISTNAME= MPlayer-1.0pre7
MAINTAINER= riggs at rrr.de
COMMENT= High performance media player/encoder supporting many formats
@@ -697,6 +700,7 @@
.endif
.if defined(WITH_VORBIS)
+CONFIGURE_ARGS+= --disable-internal-tremor
LIB_DEPENDS+= vorbis.3:${PORTSDIR}/audio/libvorbis
.endif
@@ -843,9 +847,6 @@
#.endif
post-patch:
-.if (${OSVERSION} > 502125 || (defined(USE_GCC) && ${USE_GCC} == 3.4))
- @cd ${WRKSRC} && ${PATCH} < ${PATCHDIR}/extra-patch-gcc34
-.endif
@${REINPLACE_CMD} -e \
's|libxmms.so.1|libxmms.so|' \
${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
@@ -860,24 +861,12 @@
s|/dev/\\:(cdrom[[:alnum:]]*[[:>:]])|${DEFAULT_CDROM_DEVICE:S/dev\//dev\/\\\:/}|g'
.if defined(WITH_RTC)
@${REINPLACE_CMD} -e \
- 's|<linux/rtc.h>|<rtc.h>|' \
- ${WRKSRC}/mplayer.c
- @${REINPLACE_CMD} -e \
- 's|RTC_IRQP_SET|RTCIO_IRQP_SET|' \
- ${WRKSRC}/mplayer.c
- @${REINPLACE_CMD} -e \
- 's|RTC_PIE_ON|RTCIO_PIE_ON|' \
- ${WRKSRC}/mplayer.c
- @${REINPLACE_CMD} -e \
- 's|rtc_fd|rtc|' \
- ${WRKSRC}/mplayer.c
- @${REINPLACE_CMD} -e \
's|irqp = 1024|irqp = ${DEFAULT_KERN_HZ}|' \
${WRKSRC}/mplayer.c
.endif
.if defined(MPLAYER_GENERIC_BUILD)
@${REINPLACE_CMD} -e \
- 's|1.0pre6|1.0pre6-FreeBSD-generic|' \
+ 's|1.0pre7|1.0pre7-FreeBSD-generic|' \
${WRKSRC}/version.sh
.endif
diff -ruN mplayer-old/distinfo mplayer/distinfo
--- mplayer-old/distinfo Mon Mar 7 08:15:41 2005
+++ mplayer/distinfo Mon Apr 25 20:35:39 2005
@@ -1,2 +1,2 @@
-MD5 (MPlayer-1.0pre6a.tar.bz2) = a812d945b884c2e2fa7f90c57cd76bff
-SIZE (MPlayer-1.0pre6a.tar.bz2) = 6380482
+MD5 (MPlayer-1.0pre7.tar.bz2) = 5fadd6957d3aab989cd760ff38fb8fdf
+SIZE (MPlayer-1.0pre7.tar.bz2) = 6868877
diff -ruN mplayer-old/files/extra-patch-gcc34 mplayer/files/extra-patch-gcc34
--- mplayer-old/files/extra-patch-gcc34 Mon Mar 7 08:15:41 2005
+++ mplayer/files/extra-patch-gcc34 Thu Jan 1 01:00:00 1970
@@ -1,163 +0,0 @@
---- libaf/af_format.c.orig Sat Aug 7 20:30:05 2004
-+++ libaf/af_format.c Sat Aug 7 20:32:03 2004
-@@ -15,8 +15,13 @@
-
- // Integer to float conversion through lrintf()
- #ifdef HAVE_LRINTF
-+#ifdef __FreeBSD__
-+#include <math.h>
-+#define lrintf(x) rintf(x)
-+#else
- #define __USE_ISOC99 1
- #include <math.h>
-+#endif
- #else
- #define lrintf(x) ((int)(x))
- #endif
---- libavcodec/faandct.c.orig Sat Aug 7 20:45:54 2004
-+++ libavcodec/faandct.c Sat Aug 7 20:46:18 2004
-@@ -29,6 +29,21 @@
- #include "dsputil.h"
- #include "faandct.h"
-
-+#include "config.h"
-+
-+// Integer to float conversion through lrintf()
-+#ifdef HAVE_LRINTF
-+#ifdef __FreeBSD__
-+#include <math.h>
-+#define lrintf(x) rintf(x)
-+#else
-+#define __USE_ISOC99 1
-+#include <math.h>
-+#endif
-+#else
-+#define lrintf(x) ((int)(x))
-+#endif
-+
- #define FLOAT float
- #ifdef FAAN_POSTSCALE
- # define SCALE(x) postscale[x]
---- libavcodec/mpegaudiodec.c.orig Sat Aug 7 20:43:50 2004
-+++ libavcodec/mpegaudiodec.c Sat Aug 7 20:44:23 2004
-@@ -27,6 +27,21 @@
- #include "mpegaudio.h"
- #include "dsputil.h"
-
-+#include "config.h"
-+
-+// Integer to float conversion through lrintf()
-+#ifdef HAVE_LRINTF
-+#ifdef __FreeBSD__
-+#include <math.h>
-+#define lrintf(x) rintf(x)
-+#else
-+#define __USE_ISOC99 1
-+#include <math.h>
-+#endif
-+#else
-+#define lrintf(x) ((int)(x))
-+#endif
-+
- /*
- * TODO:
- * - in low precision mode, use more 16 bit multiplies in synth filter
---- libavcodec/mpegvideo.c.orig Sat Aug 7 20:41:35 2004
-+++ libavcodec/mpegvideo.c Sat Aug 7 20:42:36 2004
-@@ -38,6 +38,21 @@
- //#undef NDEBUG
- //#include <assert.h>
-
-+#include "config.h"
-+
-+// Integer to float conversion through lrintf()
-+#ifdef HAVE_LRINTF
-+#ifdef __FreeBSD__
-+#include <math.h>
-+#define lrintf(x) rintf(x)
-+#else
-+#define __USE_ISOC99 1
-+#include <math.h>
-+#endif
-+#else
-+#define lrintf(x) ((int)(x))
-+#endif
-+
- #ifdef CONFIG_ENCODERS
- static void encode_picture(MpegEncContext *s, int picture_number);
- #endif //CONFIG_ENCODERS
---- libavcodec/wmadec.c.orig Sat Aug 7 20:47:09 2004
-+++ libavcodec/wmadec.c Sat Aug 7 20:47:30 2004
-@@ -34,6 +34,21 @@
- #include "avcodec.h"
- #include "dsputil.h"
-
-+#include "config.h"
-+
-+// Integer to float conversion through lrintf()
-+#ifdef HAVE_LRINTF
-+#ifdef __FreeBSD__
-+#include <math.h>
-+#define lrintf(x) rintf(x)
-+#else
-+#define __USE_ISOC99 1
-+#include <math.h>
-+#endif
-+#else
-+#define lrintf(x) ((int)(x))
-+#endif
-+
- /* size of blocks */
- #define BLOCK_MIN_BITS 7
- #define BLOCK_MAX_BITS 11
---- libmpcodecs/vf_qp.c.orig Sat Aug 7 20:26:22 2004
-+++ libmpcodecs/vf_qp.c Sat Aug 7 20:33:45 2004
-@@ -19,10 +19,22 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
--#include <math.h>
- #include <inttypes.h>
-
- #include "../config.h"
-+
-+// Integer to float conversion through lrintf()
-+#ifdef HAVE_LRINTF
-+#ifdef __FreeBSD__
-+#include <math.h>
-+#define lrintf(x) rintf(x)
-+#else
-+#define __USE_ISOC99 1
-+#include <math.h>
-+#endif
-+#else
-+#define lrintf(x) ((int)(x))
-+#endif
-
- #ifdef USE_LIBAVCODEC
-
---- libavcodec/dsputil.h.orig Thu Jul 15 02:18:47 2004
-+++ libavcodec/dsputil.h Thu Aug 19 23:11:22 2004
-@@ -554,7 +554,7 @@
- return score;\
- }
-
--#ifndef HAVE_LRINTF
-+#if !defined(HAVE_LRINTF) && !defined(__FreeBSD__)
- /* XXX: add ISOC specific test to avoid specific BSD testing. */
- /* better than nothing implementation. */
- /* btw, rintf() is existing on fbsd too -- alex */
---- libavcodec/resample2.c.orig Thu Dec 23 22:24:08 2004
-+++ libavcodec/resample2.c Mon Jan 10 23:03:32 2005
-@@ -28,6 +28,11 @@
- #include "common.h"
- #include "dsputil.h"
-
-+#ifdef __FreeBSD__
-+#include <math.h>
-+#define lrintf(x) rintf(x)
-+#endif
-+
- #if 1
- #define FILTER_SHIFT 15
-
diff -ruN mplayer-old/files/patch-ad mplayer/files/patch-ad
--- mplayer-old/files/patch-ad Tue Apr 12 16:20:06 2005
+++ mplayer/files/patch-ad Mon Apr 25 20:59:54 2005
@@ -1,5 +1,5 @@
---- configure.orig Thu Dec 23 16:36:00 2004
-+++ configure Tue Mar 22 10:50:03 2005
+--- configure.orig Wed Apr 13 13:46:35 2005
++++ configure Mon Apr 25 20:59:27 2005
@@ -29,9 +29,9 @@
echo >> "$TMPLOG"
cat "$TMPC" >> "$TMPLOG"
@@ -12,7 +12,7 @@
TMP="$?"
echo >> "$TMPLOG"
echo "ldd $TMPO" >> "$TMPLOG"
-@@ -359,7 +359,7 @@
+@@ -369,7 +369,7 @@
# 1st pass checking for vital options
@@ -21,7 +21,7 @@
_ranlib=ranlib
_cc=cc
test "$CC" && _cc="$CC"
-@@ -461,14 +461,7 @@
+@@ -471,14 +471,7 @@
case "`( uname -m ) 2>&1`" in
i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;;
ia64) host_arch=ia64 ;;
@@ -37,7 +37,7 @@
macppc|ppc) host_arch=ppc ;;
alpha) host_arch=alpha ;;
sparc) host_arch=sparc ;;
-@@ -681,22 +674,10 @@
+@@ -691,22 +684,10 @@
_cpuinfo="echo"
# Cygwin has /proc/cpuinfo, but only supports Intel CPUs
# FIXME: Remove the cygwin check once AMD CPUs are supported
@@ -60,7 +60,7 @@
x86_exts_check()
{
-@@ -1843,8 +1824,8 @@
+@@ -1878,8 +1859,8 @@
;;
*)
@@ -71,7 +71,7 @@
;;
esac
-@@ -1854,7 +1835,7 @@
+@@ -1889,7 +1870,7 @@
test -z "$_bindir" && _bindir="$_prefix/bin"
test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
test -z "$_mandir" && _mandir="$_prefix/man"
@@ -80,7 +80,7 @@
test -z "$_libdir" && _libdir="$_prefix/lib"
test -z "$_mlibdir" && _mlibdir="$MLIBHOME"
-@@ -2576,13 +2557,7 @@
+@@ -2591,13 +2572,7 @@
echocheck "memalign()"
@@ -94,7 +94,7 @@
if test "$_memalign" = yes ; then
_def_memalign='#define HAVE_MEMALIGN 1'
else
-@@ -2671,48 +2646,11 @@
+@@ -2699,47 +2674,11 @@
_def_threads='#undef HAVE_THREADS'
echocheck "pthread"
@@ -108,7 +108,7 @@
-elif hpux ; then
- _ld_pthread=''
-elif ( cc_check && $TMPO ) ; then # QNX
-- _ld_pthread=''
+- _ld_pthread=' ' # _ld_pthread='' would disable pthreads, but the test worked
-elif ( cc_check -lpthread && $TMPO ) ; then
- _ld_pthread='-lpthread'
-elif ( cc_check -pthread && $TMPO ) ; then
@@ -140,25 +140,10 @@
- _pthreads=''
- _def_pthreads='#undef HAVE_PTHREADS'
-fi
--
-
- echocheck "sys/soundcard.h"
- cat > $TMPC << EOF
-@@ -5000,11 +4938,11 @@
- echocheck "RTC"
--if linux ; then
-+if freebsd ; then
- if test "$_rtc" = auto ; then
- cat > $TMPC << EOF
- #include <sys/ioctl.h>
--#include <linux/rtc.h>
-+#include <rtc.h>
- int main(void) { return RTC_IRQP_READ; }
- EOF
- _rtc=no
-@@ -5235,7 +5173,7 @@
+ echocheck "sys/soundcard.h"
+@@ -5323,7 +5262,7 @@
if test "$_faad_internal" = auto ; then
# the faad check needs a config.h file
if not test -f "config.h" ; then
@@ -167,16 +152,16 @@
fi
# internal faad: check if our dear gcc is able to compile it...
cp "`pwd`/libfaad2/cfft.c" $TMPC
-@@ -6314,7 +6252,7 @@
+@@ -6477,7 +6416,7 @@
fi
_stripbinaries=no
elif test -z "$CFLAGS" ; then
- CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
-+ CFLAGS="-O"
++ CFLAGS="-O $_pipe"
# always compile with '-g' if .developer:
if test -f ".developer" ; then
CFLAGS="-g $CFLAGS"
-@@ -6324,6 +6262,9 @@
+@@ -6487,6 +6426,9 @@
_stripbinaries=no
fi
else
@@ -186,7 +171,7 @@
cat <<EOF
MPlayer compilation will use the CFLAGS set by you, but:
-@@ -6363,7 +6304,7 @@
+@@ -6526,7 +6468,7 @@
CFLAGS="$CFLAGS -D_REENTRANT"
elif bsd ; then
# FIXME bsd needs this so maybe other OS'es
diff -ruN mplayer-old/files/patch-libmpcodecs-ve_x264.c mplayer/files/patch-libmpcodecs-ve_x264.c
--- mplayer-old/files/patch-libmpcodecs-ve_x264.c Mon Apr 25 13:37:34 2005
+++ mplayer/files/patch-libmpcodecs-ve_x264.c Thu Jan 1 01:00:00 1970
@@ -1,291 +0,0 @@
---- libmpcodecs/ve_x264.c.orig Tue Nov 23 19:54:20 2004
-+++ libmpcodecs/ve_x264.c Thu Apr 21 08:31:22 2005
-@@ -49,10 +49,6 @@
-
- #include <x264.h>
-
--#if X264_BUILD < 0x000c
--#error We do not support old versions of x264. Get the latest from SVN.
--#endif
--
- typedef struct _h264_module_t {
- muxer_stream_t *mux;
- x264_param_t param;
-@@ -65,20 +61,28 @@
- static int bitrate = -1;
- static int qp_constant = 26;
- static int frame_ref = 1;
--static int iframe = 250;
--static int idrframe = 2;
-+static int keyint_max = 250;
-+static int keyint_min = -1;
- static int scenecut_threshold = 40;
- static int bframe = 0;
-+static int bframe_adaptive = 1;
-+static int bframe_bias = 0;
-+static int bframe_pyramid = 0;
- static int deblock = 1;
- static int deblockalpha = 0;
- static int deblockbeta = 0;
- static int cabac = 1;
--static int cabacidc = -1;
- static int p4x4mv = 0;
-+static int p8x8mv = 1;
-+static int b8x8mv = 1;
-+static int direct_pred = X264_DIRECT_PRED_TEMPORAL;
-+static int weight_b = 0;
-+static int chroma_me = 1;
-+static int chroma_qp_offset = 0;
- static float ip_factor = 1.4;
--static float pb_factor = 1.4;
-+static float pb_factor = 1.3;
- static int rc_buffer_size = -1;
--static int rc_init_buffer = -1;
-+static float rc_init_buffer = 0.25;
- static int rc_sens = 4;
- static int qp_min = 10;
- static int qp_max = 51;
-@@ -87,48 +91,66 @@
- static float qcomp = 0.6;
- static float qblur = 0.5;
- static float complexity_blur = 20;
--static char *rc_eq = "tex*blurTex^(qComp-1)";
--static int subq = 1;
-+static char *rc_eq = "blurCplx^(1-qComp)";
-+static int subq = 5;
-+static int level_idc = 40;
- static int psnr = 0;
- static int log_level = 2;
-
- m_option_t x264encopts_conf[] = {
- {"bitrate", &bitrate, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL},
- {"qp_constant", &qp_constant, CONF_TYPE_INT, CONF_RANGE, 1, 51, NULL},
-- {"frameref", &frame_ref, CONF_TYPE_INT, CONF_RANGE, 1, 15, NULL},
-- {"keyint", &iframe, CONF_TYPE_INT, CONF_RANGE, 1, 24000000, NULL},
-- {"idrint", &idrframe, CONF_TYPE_INT, CONF_RANGE, 1, 24000000, NULL},
-+ {"frameref", &frame_ref, CONF_TYPE_INT, CONF_RANGE, 1, 16, NULL},
-+ {"keyint", &keyint_max, CONF_TYPE_INT, CONF_RANGE, 1, 24000000, NULL},
-+ {"keyint_min", &keyint_min, CONF_TYPE_INT, CONF_RANGE, 1, 24000000, NULL},
- {"scenecut", &scenecut_threshold, CONF_TYPE_INT, CONF_RANGE, -1, 100, NULL},
- {"bframes", &bframe, CONF_TYPE_INT, CONF_RANGE, 0, 16, NULL},
-+ {"b_adapt", &bframe_adaptive, CONF_TYPE_FLAG, 0, 0, 1, NULL},
-+ {"nob_adapt", &bframe_adaptive, CONF_TYPE_FLAG, 0, 1, 0, NULL},
-+ {"b_bias", &bframe_bias, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
-+ {"b_pyramid", &bframe_pyramid, CONF_TYPE_FLAG, 0, 0, 1, NULL},
-+ {"nob_pyramid", &bframe_pyramid, CONF_TYPE_FLAG, 0, 1, 0, NULL},
- {"deblock", &deblock, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- {"nodeblock", &deblock, CONF_TYPE_FLAG, 0, 1, 0, NULL},
- {"deblockalpha", &deblockalpha, CONF_TYPE_INT, CONF_RANGE, -6, 6, NULL},
- {"deblockbeta", &deblockbeta, CONF_TYPE_INT, CONF_RANGE, -6, 6, NULL},
- {"cabac", &cabac, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- {"nocabac", &cabac, CONF_TYPE_FLAG, 0, 1, 0, NULL},
-- {"cabacidc", &cabacidc, CONF_TYPE_INT, CONF_RANGE, -1, 2, NULL},
- {"4x4mv", &p4x4mv, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- {"no4x4mv", &p4x4mv, CONF_TYPE_FLAG, 0, 1, 0, NULL},
-+ {"8x8mv", &p8x8mv, CONF_TYPE_FLAG, 0, 0, 1, NULL},
-+ {"no8x8mv", &p8x8mv, CONF_TYPE_FLAG, 0, 1, 0, NULL},
-+ {"b8x8mv", &b8x8mv, CONF_TYPE_FLAG, 0, 0, 1, NULL},
-+ {"nob8x8mv", &b8x8mv, CONF_TYPE_FLAG, 0, 1, 0, NULL},
-+ {"direct_pred", &direct_pred, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL},
-+ {"weight_b", &weight_b, CONF_TYPE_FLAG, 0, 0, 1, NULL},
-+ {"noweight_b", &weight_b, CONF_TYPE_FLAG, 0, 1, 0, NULL},
-+ {"chroma_me", &chroma_me, CONF_TYPE_FLAG, 0, 0, 1, NULL},
-+ {"nochroma_me", &chroma_me, CONF_TYPE_FLAG, 0, 1, 0, NULL},
-+ {"chroma_qp_offset", &chroma_qp_offset, CONF_TYPE_INT, CONF_RANGE, -12, 12, NULL},
- {"ip_factor", &ip_factor, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0, NULL},
- {"pb_factor", &pb_factor, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0, NULL},
- {"rc_buffer_size", &rc_buffer_size, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL},
-- {"rc_init_buffer", &rc_init_buffer, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL},
-+ {"rc_init_buffer", &rc_init_buffer, CONF_TYPE_FLOAT, CONF_RANGE, 0, 24000000, NULL},
- {"rc_sens", &rc_sens, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
- {"qp_min", &qp_min, CONF_TYPE_INT, CONF_RANGE, 1, 51, NULL},
- {"qp_max", &qp_max, CONF_TYPE_INT, CONF_RANGE, 1, 51, NULL},
-- {"qp_step", &qp_step, CONF_TYPE_INT, CONF_RANGE, 0, 50, NULL},
-+ {"qp_step", &qp_step, CONF_TYPE_INT, CONF_RANGE, 1, 50, NULL},
- {"pass", &pass, CONF_TYPE_INT, CONF_RANGE, 1, 3, NULL},
- {"rc_eq", &rc_eq, CONF_TYPE_STRING, 0, 0, 0, NULL},
- {"qcomp", &qcomp, CONF_TYPE_FLOAT, CONF_RANGE, 0, 1, NULL},
- {"qblur", &qblur, CONF_TYPE_FLOAT, CONF_RANGE, 0, 99, NULL},
- {"cplx_blur", &complexity_blur, CONF_TYPE_FLOAT, CONF_RANGE, 0, 999, NULL},
-- {"subq", &subq, CONF_TYPE_INT, CONF_RANGE, 0, 5, NULL},
-+ {"subq", &subq, CONF_TYPE_INT, CONF_RANGE, 1, 5, NULL},
-+ {"level_idc", &level_idc, CONF_TYPE_INT, CONF_RANGE, 10, 51, NULL},
- {"psnr", &psnr, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- {"nopsnr", &psnr, CONF_TYPE_FLAG, 0, 1, 0, NULL},
- {"log", &log_level, CONF_TYPE_INT, CONF_RANGE, -1, 3, NULL},
- {NULL, NULL, 0, 0, 0, 0, NULL}
- };
--
-+
-+static int put_image(struct vf_instance_s *vf, mp_image_t *mpi);
-+static int encode_frame(struct vf_instance_s *vf, x264_picture_t *pic_in);
-
- static int config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt) {
- h264_module_t *mod=(h264_module_t*)vf->priv;
-@@ -138,15 +160,17 @@
-
- x264_param_default(&mod->param);
- mod->param.i_frame_reference = frame_ref;
-- mod->param.i_idrframe = idrframe;
-- mod->param.i_iframe = iframe;
-+ mod->param.i_keyint_max = keyint_max;
-+ mod->param.i_keyint_min = keyint_min > 0 ? keyint_min : keyint_max * 2 / 5;
- mod->param.i_scenecut_threshold = scenecut_threshold;
- mod->param.i_bframe = bframe;
-+ mod->param.b_bframe_adaptive = bframe_adaptive;
-+ mod->param.i_bframe_bias = bframe_bias;
-+ mod->param.b_bframe_pyramid = bframe_pyramid;
- mod->param.b_deblocking_filter = deblock;
- mod->param.i_deblocking_filter_alphac0 = deblockalpha;
- mod->param.i_deblocking_filter_beta = deblockbeta;
- mod->param.b_cabac = cabac;
-- mod->param.i_cabac_init_idc = cabacidc;
-
- mod->param.rc.i_qp_constant = qp_constant;
- if(qp_min > qp_constant)
-@@ -190,23 +214,34 @@
- if(bitrate > 0) {
- if(rc_buffer_size <= 0)
- rc_buffer_size = bitrate;
-- if(rc_init_buffer < 0)
-- rc_init_buffer = rc_buffer_size/4;
- mod->param.rc.b_cbr = 1;
- mod->param.rc.i_bitrate = bitrate;
- mod->param.rc.i_rc_buffer_size = rc_buffer_size;
-- mod->param.rc.i_rc_init_buffer = rc_init_buffer;
-+ if(rc_init_buffer > 1)
-+ mod->param.rc.i_rc_init_buffer = rc_init_buffer;
-+ else
-+ mod->param.rc.i_rc_init_buffer = rc_buffer_size * rc_init_buffer;
- mod->param.rc.i_rc_sens = rc_sens;
- }
-- if(p4x4mv)
-- mod->param.analyse.inter = X264_ANALYSE_I4x4 | X264_ANALYSE_PSUB16x16 | X264_ANALYSE_PSUB8x8;
- mod->param.rc.f_ip_factor = ip_factor;
- mod->param.rc.f_pb_factor = pb_factor;
-+ mod->param.analyse.inter = X264_ANALYSE_I4x4;
-+ if(p4x4mv)
-+ mod->param.analyse.inter |= X264_ANALYSE_PSUB8x8;
-+ if(p8x8mv)
-+ mod->param.analyse.inter |= X264_ANALYSE_PSUB16x16;
-+ if(b8x8mv)
-+ mod->param.analyse.inter |= X264_ANALYSE_BSUB16x16;
-+ mod->param.analyse.i_direct_mv_pred = direct_pred;
-+ mod->param.analyse.b_weighted_bipred = weight_b;
-+ mod->param.analyse.i_chroma_qp_offset = chroma_qp_offset;
-+ mod->param.analyse.b_chroma_me = chroma_me;
-
- mod->param.i_width = width;
- mod->param.i_height = height;
- mod->param.i_fps_num = mod->mux->h.dwRate;
- mod->param.i_fps_den = mod->mux->h.dwScale;
-+ mod->param.i_level_idc = level_idc;
- mod->param.analyse.b_psnr = psnr;
- mod->param.i_log_level = log_level;
- mod->param.vui.i_sar_width = d_width*height;
-@@ -256,13 +291,19 @@
- return 0;
- }
-
-- x264_picture_alloc(&mod->pic, mod->param.i_csp, mod->param.i_width, mod->param.i_height);
- return 1;
- }
-
- static int control(struct vf_instance_s* vf, int request, void *data)
- {
-- return CONTROL_UNKNOWN;
-+ switch(request){
-+ case VFCTRL_FLUSH_FRAMES:
-+ if(bframe)
-+ while(encode_frame(vf, NULL) > 0);
-+ return CONTROL_TRUE;
-+ default:
-+ return CONTROL_UNKNOWN;
-+ }
- }
-
- static int query_format(struct vf_instance_s* vf, unsigned int fmt)
-@@ -277,9 +318,8 @@
- case IMGFMT_RGB:
- case IMGFMT_BGR:
- case IMGFMT_BGR32:
-- /* 2004/08/05: There seems to be some, but not complete,
-- support for these colorspaces in X264. Better to stay
-- on the safe side for now. */
-+ /* These colorspaces are supported, but they'll just have
-+ * to be converted to I420 internally */
- return 0; /* VFCAP_CSP_SUPPORTED */
- }
- return 0;
-@@ -288,14 +328,10 @@
- static int put_image(struct vf_instance_s *vf, mp_image_t *mpi)
- {
- h264_module_t *mod=(h264_module_t*)vf->priv;
-- int i_nal;
-- x264_nal_t *nal;
- int i;
-- int i_size = 0;
-
-- int csp=mod->pic.img.i_csp;
- memset(&mod->pic, 0, sizeof(x264_picture_t));
-- mod->pic.img.i_csp=csp;
-+ mod->pic.img.i_csp=mod->param.i_csp;
- mod->pic.img.i_plane=3;
- for(i=0; i<4; i++) {
- mod->pic.img.plane[i] = mpi->planes[i];
-@@ -303,9 +339,22 @@
- }
-
- mod->pic.i_type = X264_TYPE_AUTO;
-- if(x264_encoder_encode(mod->x264, &nal, &i_nal, &mod->pic) < 0) {
-+
-+ return encode_frame(vf, &mod->pic) >= 0;
-+}
-+
-+static int encode_frame(struct vf_instance_s *vf, x264_picture_t *pic_in)
-+{
-+ h264_module_t *mod=(h264_module_t*)vf->priv;
-+ x264_picture_t pic_out;
-+ x264_nal_t *nal;
-+ int i_nal;
-+ int i_size = 0;
-+ int i;
-+
-+ if(x264_encoder_encode(mod->x264, &nal, &i_nal, pic_in, &pic_out) < 0) {
- mp_msg(MSGT_MENCODER, MSGL_ERR, "x264_encoder_encode failed\n");
-- return 0;
-+ return -1;
- }
-
- for(i=0; i < i_nal; i++) {
-@@ -313,25 +362,25 @@
- i_size += x264_nal_encode(mod->mux->buffer + i_size, &i_data, 1, &nal[i]);
- }
- if(i_size>0) {
-- int keyframe = (mod->pic.i_type == X264_TYPE_IDR) ||
-- (mod->pic.i_type == X264_TYPE_I && frame_ref == 1);
-+ int keyframe = (pic_out.i_type == X264_TYPE_IDR) ||
-+ (pic_out.i_type == X264_TYPE_I
-+ && frame_ref == 1 && !bframe);
- muxer_write_chunk(mod->mux, i_size, keyframe?0x10:0);
- }
-- return 1;
-+
-+ return i_size;
- }
-
- static void uninit(struct vf_instance_s *vf)
- {
-- // FIXME: flush delayed frames
- h264_module_t *mod=(h264_module_t*)vf->priv;
- x264_encoder_close(mod->x264);
-- //x264_picture_clean(&mod->pic);
- }
-
- static int vf_open(vf_instance_t *vf, char *args) {
- h264_module_t *mod;
-
- vf->config = config;
- vf->control = control;
- vf->query_format = query_format;
- vf->put_image = put_image;
diff -ruN mplayer-old/files/patch-mplayer.c mplayer/files/patch-mplayer.c
--- mplayer-old/files/patch-mplayer.c Sun Mar 6 11:34:16 2005
+++ mplayer/files/patch-mplayer.c Thu Jan 1 01:00:00 1970
@@ -1,11 +0,0 @@
---- mplayer.c.orig Tue Dec 21 13:25:58 2004
-+++ mplayer.c Mon Jan 10 22:43:29 2005
-@@ -93,7 +93,7 @@
- #define ROUND(x) ((int)((x)<0 ? (x)-0.5 : (x)+0.5))
-
- #ifdef HAVE_RTC
--#include <linux/rtc.h>
-+#include <rtc.h>
- #endif
-
- #ifdef USE_TV
diff -ruN mplayer-old/pkg-plist mplayer/pkg-plist
--- mplayer-old/pkg-plist Mon Mar 7 08:15:41 2005
+++ mplayer/pkg-plist Mon Apr 25 21:55:09 2005
@@ -46,7 +46,6 @@
%%PORTDOCS%%%%DOCSDIR%%/menc-feat-mpeg.html
%%PORTDOCS%%%%DOCSDIR%%/menc-feat-mpeg4.html
%%PORTDOCS%%%%DOCSDIR%%/menc-feat-extractsub.html
-%%PORTDOCS%%%%DOCSDIR%%/menc-feat-fix-avi.html
%%PORTDOCS%%%%DOCSDIR%%/menc-feat-rescale.html
%%PORTDOCS%%%%DOCSDIR%%/menc-feat-streamcopy.html
%%PORTDOCS%%%%DOCSDIR%%/mencoder.html
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list