summaryrefslogtreecommitdiff
path: root/libre/mplayer-vaapi-libre
diff options
context:
space:
mode:
Diffstat (limited to 'libre/mplayer-vaapi-libre')
-rw-r--r--libre/mplayer-vaapi-libre/PKGBUILD71
-rw-r--r--libre/mplayer-vaapi-libre/gcc-4.6-mp3lib-sse-code-miscompilation.patch21
-rw-r--r--libre/mplayer-vaapi-libre/patch-fixes.patch386
3 files changed, 435 insertions, 43 deletions
diff --git a/libre/mplayer-vaapi-libre/PKGBUILD b/libre/mplayer-vaapi-libre/PKGBUILD
index 1cab3e716..e06c9a9b1 100644
--- a/libre/mplayer-vaapi-libre/PKGBUILD
+++ b/libre/mplayer-vaapi-libre/PKGBUILD
@@ -4,8 +4,9 @@
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Hugo Doria <hugo@archlinux.org>
+_pkgname=mplayer-vaapi
pkgname=mplayer-vaapi-libre
-pkgver=33025
+pkgver=33161
_vaapi_version=20110127
pkgrel=3
pkgdesc="A movie player, compiled with vaapi support, without faac dependency, added speex support"
@@ -13,63 +14,73 @@ arch=('i686' 'x86_64' 'mips64el')
url="http://www.splitted-desktop.com/~gbeauchesne/mplayer-vaapi/"
license=('GPL')
depends=('libxxf86dga' 'libxxf86vm' 'libmad' 'cdparanoia' 'libxinerama' 'sdl'
- 'lame' 'libtheora' 'xvidcore' 'libmng' 'libxss' 'libgl' 'smbclient'
+ 'lame' 'libtheora' 'xvidcore' 'libmng' 'libxss' 'mesa' 'smbclient'
'aalib' 'jack' 'libcaca' 'x264' 'lirc-utils' 'ttf-dejavu' 'speex'
'libxvmc' 'enca' 'opencore-amr' 'libdca' 'a52dec' 'schroedinger'
- 'libvpx' 'libpulse' 'fribidi' 'libva' 'desktop-file-utils')
-makedepends=('unzip' 'mesa' 'live-media>=2010.01.13' 'yasm')
-provides=("mplayer-vaapi=$pkgver" 'mplayer')
-conflicts=('mplayer' 'mplayer-vaapi')
+ 'libvpx' 'libpulse' 'fribidi' 'faad2' 'libva' 'libass'
+ 'desktop-file-utils')
+makedepends=('unzip' 'live-media' 'yasm' 'ladspa')
+provides=("$_pkgname=$pkgver" 'mplayer')
+conflicts=('mplayer' "$_pkgname")
replaces=('mplayer-vaapi')
backup=('etc/mplayer/codecs.conf' 'etc/mplayer/input.conf')
source=(http://pkgbuild.com/~foutrelis/mplayer-$pkgver.tar.xz
http://www.splitted-desktop.com/~gbeauchesne/mplayer-vaapi/mplayer-vaapi-$_vaapi_version.tar.bz2
mplayer.desktop
mplayer.png
- patch-fixes.patch)
+ patch-fixes.patch
+ gcc-4.6-mp3lib-sse-code-miscompilation.patch)
+options=('!buildflags' '!emptydirs')
install=mplayer-vaapi.install
-md5sums=('3814e5c47458de4bf0878d3996820341'
+md5sums=('b8b2842ba3fff04a9b64a94bd2b0a667'
'b39bd73ae8241dcb21dd1a8fa5eb87eb'
'647b9f4ab5284a7fef3f84f992214e77'
'd00874ccc644b7f43d6ef1c942fcef28'
- '9f96a03dddbea8be5ff2fa3925311d04')
+ 'c7a1df1c1d0f1e51ee400d96b0f34195'
+ 'd56174335d3c5bcdf3732f4a869f01dd')
build() {
cd "$srcdir/mplayer-$pkgver"
- # Custom CFLAGS break the mplayer build
- unset CFLAGS LDFLAGS
-
# Update vaapi patches for changes introduced in mplayer/ffmpeg
patch -d "$srcdir/mplayer-vaapi-$_vaapi_version" -p1 -i \
"$srcdir/patch-fixes.patch"
+ # Workaround mp3lib SSE code miscompilation with gcc 4.6 (r33469 upstream)
+ # Patch by Jindrich Makovicka <makovick <at> gmail>
+ patch -Np0 -i "$srcdir/gcc-4.6-mp3lib-sse-code-miscompilation.patch"
+
for patch in mplayer-{vaapi{,-{gma500-workaround,0.29}},vdpau}; do
patch -Np1 -i "$srcdir/mplayer-vaapi-$_vaapi_version/patches/$patch.patch"
done
./configure --prefix=/usr \
- --disable-faac \
- --enable-runtime-cpudetection \
- --disable-gui \
- --disable-arts \
- --disable-liblzo \
- --enable-speex \
- --disable-openal \
- --disable-libdv \
- --disable-musepack \
- --disable-esd \
- --disable-mga \
- --enable-xvmc \
- --disable-vdpau \
- --enable-vaapi \
- --language=all \
- --confdir=/etc/mplayer
+ --enable-runtime-cpudetection \
+ --disable-gui \
+ --disable-arts \
+ --disable-liblzo \
+ --enable-speex \
+ --disable-openal \
+ --disable-libdv \
+ --disable-musepack \
+ --disable-esd \
+ --disable-mga \
+ --disable-faac \
+ --enable-xvmc \
+ --disable-vdpau \
+ --enable-vaapi \
+ --language=all \
+ --confdir=/etc/mplayer
- [ "$CARCH" = "i686" ] && sed 's|-march=i486|-march=i686|g' -i config.mak
+ [[ $CARCH == i686 ]] && sed -i 's|-march=i486|-march=i686|g' config.mak
make
- make -j1 DESTDIR=$pkgdir install
+}
+
+package() {
+ cd "$srcdir/mplayer-$pkgver"
+
+ make -j1 DESTDIR="$pkgdir" install-mplayer install-mplayer-man
install -Dm644 etc/{codecs.conf,input.conf,example.conf} "$pkgdir/etc/mplayer/"
install -dm755 "$pkgdir/usr/share/mplayer/"
ln -s /usr/share/fonts/TTF/DejaVuSans.ttf "$pkgdir/usr/share/mplayer/subfont.ttf"
diff --git a/libre/mplayer-vaapi-libre/gcc-4.6-mp3lib-sse-code-miscompilation.patch b/libre/mplayer-vaapi-libre/gcc-4.6-mp3lib-sse-code-miscompilation.patch
new file mode 100644
index 000000000..58daa09e7
--- /dev/null
+++ b/libre/mplayer-vaapi-libre/gcc-4.6-mp3lib-sse-code-miscompilation.patch
@@ -0,0 +1,21 @@
+Index: mp3lib/dct64_sse.c
+===================================================================
+--- mp3lib/dct64_sse.c (revision 33468)
++++ mp3lib/dct64_sse.c (revision 33469)
+@@ -112,7 +112,6 @@
+ }
+
+ {
+- real *costab = costab_mmx + 24;
+ int i;
+
+ __asm__(
+@@ -121,7 +120,7 @@
+ "movaps %1, %%xmm5\n\t"
+ "movaps %%xmm5, %%xmm6\n\t"
+ :
+- :"m"(*costab), "m"(*nnnn)
++ :"m"(costab_mmx[24]), "m"(*nnnn)
+ );
+
+ for (i = 0; i < 0x20; i += 8)
diff --git a/libre/mplayer-vaapi-libre/patch-fixes.patch b/libre/mplayer-vaapi-libre/patch-fixes.patch
index 73153b3fe..5da97d1d9 100644
--- a/libre/mplayer-vaapi-libre/patch-fixes.patch
+++ b/libre/mplayer-vaapi-libre/patch-fixes.patch
@@ -1,7 +1,61 @@
+diff -upr mplayer-vaapi-20110127.orig/patches/mplayer-vaapi-0.29.patch mplayer-vaapi-20110127/patches/mplayer-vaapi-0.29.patch
+--- mplayer-vaapi-20110127.orig/patches/mplayer-vaapi-0.29.patch 2011-01-27 17:15:16.000000000 +0200
++++ mplayer-vaapi-20110127/patches/mplayer-vaapi-0.29.patch 2011-03-30 21:22:32.000000000 +0300
+@@ -434,7 +434,7 @@ diff --git a/ffmpeg/libavcodec/vaapi_vc1
+ index 34e9056..b29e50e 100644
+ --- a/ffmpeg/libavcodec/vaapi_vc1.c
+ +++ b/ffmpeg/libavcodec/vaapi_vc1.c
+-@@ -146,101 +146,103 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t
++@@ -146,103 +146,103 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t
+ pic_param = ff_vaapi_alloc_pic_param(vactx, sizeof(VAPictureParameterBufferVC1));
+ if (!pic_param)
+ return -1;
+@@ -452,7 +452,9 @@ index 34e9056..b29e50e 100644
+ - pic_param->sequence_fields.bits.syncmarker = s->resync_marker;
+ - pic_param->sequence_fields.bits.rangered = v->rangered;
+ - pic_param->sequence_fields.bits.max_b_frames = s->avctx->max_b_frames;
++-#if VA_CHECK_VERSION(0,32,0)
+ - pic_param->sequence_fields.bits.profile = v->profile;
++-#endif
+ - pic_param->coded_width = s->avctx->coded_width;
+ - pic_param->coded_height = s->avctx->coded_height;
+ - pic_param->entrypoint_fields.value = 0; /* reset all bits */
diff -upr mplayer-vaapi-20110127.orig/patches/mplayer-vaapi.patch mplayer-vaapi-20110127/patches/mplayer-vaapi.patch
--- mplayer-vaapi-20110127.orig/patches/mplayer-vaapi.patch 2011-01-27 17:15:29.000000000 +0200
-+++ mplayer-vaapi-20110127/patches/mplayer-vaapi.patch 2011-03-05 06:47:20.000000000 +0200
-@@ -449,14 +449,15 @@ diff --git a/fmt-conversion.c b/fmt-conv
++++ mplayer-vaapi-20110127/patches/mplayer-vaapi.patch 2011-03-30 21:09:14.000000000 +0300
+@@ -207,15 +207,6 @@ index 1e0f7fc..45e4574 100755
+ echocheck "Xv"
+ if test "$_xv" = auto ; then
+ _xv=no
+-@@ -4372,7 +4435,7 @@ if test "$_vdpau" = yes ; then
+- else
+- def_vdpau='#define CONFIG_VDPAU 0'
+- novomodules="vdpau $novomodules"
+-- libavdecoders=$(echo $libavdecoders | sed -e s/MPEG_VDPAU_DECODER// -e s/MPEG1_VDPAU_DECODER// -e s/H264_VDPAU_DECODER// -e s/WMV3_VDPAU_DECODER// -e s/VC1_VDPAU_DECODER// -e s/MPEG4_VDPAU_DECODER//)
+-+ libavdecoders=$(echo $libavdecoders | sed -e "s/\(MPEG\|MPEG[124]\|H26[34]\|WMV3\|VC1\)_VDPAU_DECODER//g")
+- fi
+- echores "$_vdpau"
+-
+ @@ -4791,6 +4854,31 @@ echores "$_corevideo"
+ fi #if darwin
+
+@@ -433,30 +424,19 @@ index d353bb5..e39a926 100644
+ out YV12,I420,IYUV
+
+ videocodec ffzygo
+-diff --git a/ffmpeg/libavcodec/vaapi_vc1.c b/ffmpeg/libavcodec/vaapi_vc1.c
+-index 2c24042..34e9056 100644
+---- a/ffmpeg/libavcodec/vaapi_vc1.c
+-+++ b/ffmpeg/libavcodec/vaapi_vc1.c
+-@@ -160,6 +160,7 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t
+- pic_param->sequence_fields.bits.syncmarker = s->resync_marker;
+- pic_param->sequence_fields.bits.rangered = v->rangered;
+- pic_param->sequence_fields.bits.max_b_frames = s->avctx->max_b_frames;
+-+ pic_param->sequence_fields.bits.profile = v->profile;
+- pic_param->coded_width = s->avctx->coded_width;
+- pic_param->coded_height = s->avctx->coded_height;
+- pic_param->entrypoint_fields.value = 0; /* reset all bits */
+ diff --git a/fmt-conversion.c b/fmt-conversion.c
index 9e88100..bd32ce8 100644
--- a/fmt-conversion.c
+++ b/fmt-conversion.c
@@ -20,7 +74,7 @@ diff -upr mplayer-vaapi-20110127.orig/patches/mplayer-vaapi.patch mplayer-vaapi-
static const struct {
int fmt;
enum PixelFormat pix_fmt;
-@@ -503,14 +504,15 @@ diff --git a/fmt-conversion.h b/fmt-conv
+@@ -503,14 +483,15 @@ diff --git a/fmt-conversion.h b/fmt-conv
index 9e133a8..962ca4e 100644
--- a/fmt-conversion.h
+++ b/fmt-conversion.h
@@ -39,10 +93,126 @@ diff -upr mplayer-vaapi-20110127.orig/patches/mplayer-vaapi.patch mplayer-vaapi-
diff --git a/gui/mplayer/gtk/opts.c b/gui/mplayer/gtk/opts.c
index 4f7ffb2..0da5434 100644
--- a/gui/mplayer/gtk/opts.c
+@@ -808,7 +789,7 @@ index 7c68a20..609ac41 100644
+ sh_video_t *sh = avctx->opaque;
+ vd_ffmpeg_ctx *ctx = sh->context;
+ @@ -295,6 +296,12 @@ static int init(sh_video_t *sh){
+- avctx->codec_type = CODEC_TYPE_VIDEO;
++ avctx->codec_type = AVMEDIA_TYPE_VIDEO;
+ avctx->codec_id = lavc_codec->id;
+
+ +#if CONFIG_VAAPI
+@@ -817,9 +798,9 @@ index 7c68a20..609ac41 100644
+ + avctx->get_format = get_format;
+ + }
+ +#endif /* CONFIG_VAAPI */
+- #if CONFIG_VDPAU
+- if(lavc_codec->capabilities & CODEC_CAP_HWACCEL_VDPAU){
+- avctx->get_format = get_format;
++ avctx->get_format = get_format;
++ if(ctx->do_dr1){
++ avctx->flags|= CODEC_FLAG_EMU_EDGE;
+ @@ -487,7 +494,7 @@ static void draw_slice(struct AVCodecContext *s,
+ const AVFrame *src, int offset[4],
+ int y, int type, int height){
+@@ -841,12 +822,10 @@ index 7c68a20..609ac41 100644
+ ctx->vo_initialized = 1;
+ }
+ return 0;
+-@@ -972,24 +980,62 @@ static mp_image_t *decode(sh_video_t *sh, void *data, int len, int flags){
++@@ -974,22 +974,60 @@ static mp_image_t *decode(sh_video_t *sh
+ return mpi;
+ }
+
+--#if CONFIG_XVMC || CONFIG_VDPAU
+-+#if CONFIG_XVMC || CONFIG_VAAPI || CONFIG_VDPAU
+ +static inline int is_hwaccel_format(int imgfmt)
+ +{
+ + switch (get_video_hwaccel()) {
+@@ -883,15 +862,14 @@ index 7c68a20..609ac41 100644
+ int imgfmt;
+ sh_video_t *sh = avctx->opaque;
+ - int i;
+--
+++ int i, try_hwaccel;
++
+ - for(i=0;fmt[i]!=PIX_FMT_NONE;i++){
+ - imgfmt = pixfmt2imgfmt(fmt[i]);
+ - if(!IMGFMT_IS_HWACCEL(imgfmt)) continue;
+ - mp_msg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_MPCODECS_TryingPixfmt, i);
+ - if(init_vo(sh, fmt[i]) >= 0) {
+ - break;
+-+ int i, try_hwaccel;
+-+
+ + for (try_hwaccel = 1; try_hwaccel >= 0; --try_hwaccel) {
+ + for (i = 0; fmt[i] != PIX_FMT_NONE; i++) {
+ + imgfmt = pixfmt2imgfmt(fmt[i], avctx->codec_id);
+@@ -912,11 +890,9 @@ index 7c68a20..609ac41 100644
+ + break;
+ }
+ - selected_format = fmt[i];
++ if (selected_format == PIX_FMT_NONE)
++ selected_format = avcodec_default_get_format(avctx, fmt);
+ set_format_params(avctx, selected_format);
+- return selected_format;
+- }
+--#endif /* CONFIG_XVMC || CONFIG_VDPAU */
+-+#endif /* CONFIG_XVMC || CONFIG_VAAPI || CONFIG_VDPAU */
+ diff --git a/libmpcodecs/vf.h b/libmpcodecs/vf.h
+ index 3619e69..fd869b7 100644
+ --- a/libmpcodecs/vf.h
diff -upr mplayer-vaapi-20110127.orig/patches/mplayer-vdpau.patch mplayer-vaapi-20110127/patches/mplayer-vdpau.patch
--- mplayer-vaapi-20110127.orig/patches/mplayer-vdpau.patch 2010-11-15 08:41:19.000000000 +0200
-+++ mplayer-vaapi-20110127/patches/mplayer-vdpau.patch 2011-03-05 07:07:15.000000000 +0200
-@@ -133,7 +133,7 @@ index b0d00f4..745d3e4 100644
++++ mplayer-vaapi-20110127/patches/mplayer-vdpau.patch 2011-03-30 22:29:47.000000000 +0300
+@@ -11,15 +11,6 @@ index 91fd164..1f4434e 100755
+ libavdemuxers_all=$(sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' ffmpeg/libavformat/allformats.c | tr '[a-z]' '[A-Z]')
+ libavdemuxers=$(echo $libavdemuxers_all | sed -e 's/ LIB[A-Z0-9_]*_DEMUXER//g' -e s/REDIR_DEMUXER// -e s/AVISYNTH_DEMUXER//)
+ libavmuxers_all=$(sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' ffmpeg/libavformat/allformats.c | tr '[a-z]' '[A-Z]')
+-@@ -4466,7 +4466,7 @@ if test "$_vdpau" = yes ; then
+- else
+- def_vdpau='#define CONFIG_VDPAU 0'
+- novomodules="vdpau $novomodules"
+-- libavdecoders=$(echo $libavdecoders | sed -e "s/\(MPEG\|MPEG[124]\|H26[34]\|WMV3\|VC1\)_VDPAU_DECODER//g")
+-+ libavhwaccels=$(echo $libavhwaccels | sed -e "s/\(MPEG[124]\|H26[34]\|WMV3\|VC1\)_VDPAU_HWACCEL//g")
+- fi
+- echores "$_vdpau"
+-
+ diff --git a/etc/codecs.conf b/etc/codecs.conf
+ index b0d00f4..745d3e4 100644
+ --- a/etc/codecs.conf
+@@ -48,7 +39,7 @@ index b0d00f4..745d3e4 100644
+ out YV12,I420,IYUV
+ out 422P,444P
+
+-@@ -332,41 +335,6 @@ videocodec ffmpeg12mc
++@@ -332,38 +335,6 @@ videocodec ffmpeg12mc
+ out IDCT_MPEG2
+ out MOCO_MPEG2
+
+@@ -73,9 +64,6 @@ index b0d00f4..745d3e4 100644
+ - fourcc xdv7,xdv8,xdv9
+ - fourcc xdva,xdvb,xdvc
+ - fourcc xdvd,xdve,xdvf
+-- fourcc xd5a,xd5b,xd5c
+-- fourcc xd5d,xd5e,xd5f
+-- fourcc xd59,xd54
+ - fourcc mx5n,mx4n,mx4p
+ - fourcc mx3n,mx3p
+ - fourcc AVmp
+@@ -87,9 +75,9 @@ index b0d00f4..745d3e4 100644
+ - out VDPAU_MPEG1
+ - out VDPAU_MPEG2
+ -
+- videocodec mpegpes
+- info "MPEG-PES output (.mpg or DXR3/IVTV/DVB/V4L2 card)"
+- comment "for hardware decoding"
++ videocodec ffmpeg2crystalhd
++ info "FFmpeg MPEG-2 (CrystalHD)"
++ status working
+ @@ -943,6 +911,7 @@ videocodec ffwmv3
+ driver ffmpeg
+ dll wmv3
+@@ -133,7 +121,7 @@ index b0d00f4..745d3e4 100644
videocodec ffh264
info "FFmpeg H.264"
@@ -51,7 +221,7 @@ diff -upr mplayer-vaapi-20110127.orig/patches/mplayer-vdpau.patch mplayer-vaapi-
driver ffmpeg
dll h264
out VAAPI_H264
-@@ -146,6 +146,8 @@ index b0d00f4..745d3e4 100644
+@@ -146,6 +134,8 @@ index b0d00f4..745d3e4 100644
- fourcc X264,x264
- fourcc avc1,AVC1
- fourcc davc,DAVC
@@ -60,7 +230,111 @@ diff -upr mplayer-vaapi-20110127.orig/patches/mplayer-vdpau.patch mplayer-vaapi-
- format 0x10000005
- driver ffmpeg
- dll h264_vdpau
-@@ -362,13 +364,13 @@ index f99f7ea..faafa97 100644
+@@ -200,55 +190,41 @@ diff --git a/ffmpeg/libavcodec/allcodecs
+ index fbae0f6..4b6d2e9 100644
+ --- a/ffmpeg/libavcodec/allcodecs.c
+ +++ b/ffmpeg/libavcodec/allcodecs.c
+-@@ -65,6 +65,13 @@ void avcodec_register_all(void)
+- REGISTER_HWACCEL (WMV3_DXVA2, wmv3_dxva2);
+- REGISTER_HWACCEL (WMV3_VAAPI, wmv3_vaapi);
+-
+-+ REGISTER_HWACCEL (H264_VDPAU, h264_vdpau);
+-+ REGISTER_HWACCEL (MPEG1_VDPAU, mpeg1_vdpau);
+-+ REGISTER_HWACCEL (MPEG2_VDPAU, mpeg2_vdpau);
+-+ REGISTER_HWACCEL (MPEG4_VDPAU, mpeg4_vdpau);
+-+ REGISTER_HWACCEL (VC1_VDPAU, vc1_vdpau);
+-+ REGISTER_HWACCEL (WMV3_VDPAU, wmv3_vdpau);
+-+
+- /* video codecs */
+- REGISTER_ENCODER (A64MULTI, a64multi);
+- REGISTER_ENCODER (A64MULTI5, a64multi5);
+ @@ -116,7 +123,6 @@ void avcodec_register_all(void)
+- REGISTER_DECODER (H263I, h263i);
+ REGISTER_ENCODER (H263P, h263p);
+ REGISTER_DECODER (H264, h264);
++ REGISTER_DECODER (H264_CRYSTALHD, h264_crystalhd);
+ - REGISTER_DECODER (H264_VDPAU, h264_vdpau);
+ REGISTER_ENCDEC (HUFFYUV, huffyuv);
+ REGISTER_DECODER (IDCIN, idcin);
+ REGISTER_DECODER (IFF_BYTERUN1, iff_byterun1);
+ @@ -140,10 +146,7 @@ void avcodec_register_all(void)
+- REGISTER_ENCDEC (MPEG1VIDEO, mpeg1video);
+ REGISTER_ENCDEC (MPEG2VIDEO, mpeg2video);
+ REGISTER_ENCDEC (MPEG4, mpeg4);
++ REGISTER_DECODER (MPEG4_CRYSTALHD, mpeg4_crystalhd);
+ - REGISTER_DECODER (MPEG4_VDPAU, mpeg4_vdpau);
+ REGISTER_DECODER (MPEGVIDEO, mpegvideo);
+ - REGISTER_DECODER (MPEG_VDPAU, mpeg_vdpau);
+ - REGISTER_DECODER (MPEG1_VDPAU, mpeg1_vdpau);
++ REGISTER_DECODER (MPEG2_CRYSTALHD, mpeg2_crystalhd);
++ REGISTER_DECODER (MSMPEG4_CRYSTALHD, msmpeg4_crystalhd);
+ REGISTER_ENCDEC (MSMPEG4V1, msmpeg4v1);
+- REGISTER_ENCDEC (MSMPEG4V2, msmpeg4v2);
+- REGISTER_ENCDEC (MSMPEG4V3, msmpeg4v3);
+ @@ -196,7 +199,6 @@ void avcodec_register_all(void)
+- REGISTER_DECODER (V210X, v210x);
+ REGISTER_DECODER (VB, vb);
+ REGISTER_DECODER (VC1, vc1);
++ REGISTER_DECODER (VC1_CRYSTALHD, vc1_crystalhd);
+ - REGISTER_DECODER (VC1_VDPAU, vc1_vdpau);
+ REGISTER_DECODER (VCR1, vcr1);
+ REGISTER_DECODER (VMDVIDEO, vmdvideo);
+ REGISTER_DECODER (VMNC, vmnc);
+ @@ -210,7 +212,6 @@ void avcodec_register_all(void)
+- REGISTER_ENCDEC (WMV1, wmv1);
+ REGISTER_ENCDEC (WMV2, wmv2);
+ REGISTER_DECODER (WMV3, wmv3);
++ REGISTER_DECODER (WMV3_CRYSTALHD, wmv3_crystalhd);
+ - REGISTER_DECODER (WMV3_VDPAU, wmv3_vdpau);
+ REGISTER_DECODER (WNV1, wnv1);
+ REGISTER_DECODER (XAN_WC3, xan_wc3);
+- REGISTER_DECODER (XL, xl);
++ REGISTER_DECODER (XAN_WC4, xan_wc4);
+ diff --git a/ffmpeg/libavcodec/avcodec.h b/ffmpeg/libavcodec/avcodec.h
+ index bff9477..1e77fa6 100644
+ --- a/ffmpeg/libavcodec/avcodec.h
+@@ -285,9 +261,9 @@ index b0a3a8a..b5b9026 100644
+ #include "mpeg4video_parser.h"
+ #include "msmpeg4.h"
+ -#include "vdpau_internal.h"
++ #include "thread.h"
+ #include "flv.h"
+ #include "mpeg4video.h"
+-
+ @@ -620,11 +619,6 @@ retry:
+ if(MPV_frame_start(s, avctx) < 0)
+ return -1;
+@@ -305,23 +281,23 @@ index f99f7ea..faafa97 100644
+ --- a/ffmpeg/libavcodec/h264.c
+ +++ b/ffmpeg/libavcodec/h264.c
+ @@ -37,7 +37,6 @@
+- #include "golomb.h"
+ #include "mathops.h"
+ #include "rectangle.h"
++ #include "thread.h"
+ -#include "vdpau_internal.h"
+ #include "libavutil/avassert.h"
+
+ #include "cabac.h"
+ @@ -1647,9 +1646,6 @@ static void field_end(H264Context *h){
+- s->current_picture_ptr->qscale_type= FF_QSCALE_TYPE_H264;
+- s->current_picture_ptr->pict_type= s->pict_type;
++ ff_thread_report_progress((AVFrame*)s->current_picture_ptr, (16*s->mb_height >> FIELD_PICTURE) - 1,
++ s->picture_structure==PICT_BOTTOM_FIELD);
+
+ - if (CONFIG_H264_VDPAU_DECODER && s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
+ - ff_vdpau_h264_set_reference_frames(s);
+ -
+- if(!s->dropable) {
+- ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index);
+- h->prev_poc_msb= h->poc_msb;
++ if(in_setup || !(avctx->active_thread_type&FF_THREAD_FRAME)){
++ if(!s->dropable) {
++ ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index);
+ @@ -1663,9 +1659,6 @@ static void field_end(H264Context *h){
+ av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n");
+ }
+@@ -362,13 +338,13 @@ index f99f7ea..faafa97 100644
context_count++;
}
break;
@@ -76,7 +350,7 @@ diff -upr mplayer-vaapi-20110127.orig/patches/mplayer-vdpau.patch mplayer-vaapi-
- "h264_vdpau",
- AVMEDIA_TYPE_VIDEO,
- CODEC_ID_H264,
-@@ -381,6 +383,7 @@ index f99f7ea..faafa97 100644
+@@ -381,6 +357,7 @@ index f99f7ea..faafa97 100644
- .flush= flush_dpb,
- .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)"),
- .pix_fmts = (const enum PixelFormat[]){PIX_FMT_VDPAU_H264, PIX_FMT_NONE},
@@ -84,7 +358,16 @@ diff -upr mplayer-vaapi-20110127.orig/patches/mplayer-vdpau.patch mplayer-vaapi-
-};
-#endif
diff --git a/ffmpeg/libavcodec/mpeg12.c b/ffmpeg/libavcodec/mpeg12.c
-@@ -458,7 +461,7 @@ index 6a331eb..c226797 100644
+@@ -449,7 +426,7 @@ index 6a331eb..c226797 100644
+ - break;
+ - }
+ -
+- if(avctx->thread_count > 1){
++ if(HAVE_THREADS && avctx->active_thread_type&FF_THREAD_SLICE){
+ int threshold= (s2->mb_height*s->slice_count + avctx->thread_count/2) / avctx->thread_count;
+ if(threshold <= mb_y){
+ @@ -2578,36 +2561,3 @@ AVCodec mpeg_xvmc_decoder = {
+@@ -458,7 +435,7 @@ index 6a331eb..c226797 100644
#endif
-
-#if CONFIG_MPEG_VDPAU_DECODER
@@ -93,7 +376,7 @@ diff -upr mplayer-vaapi-20110127.orig/patches/mplayer-vdpau.patch mplayer-vaapi-
- "mpegvideo_vdpau",
- AVMEDIA_TYPE_VIDEO,
- CODEC_ID_MPEG2VIDEO,
-@@ -474,7 +477,7 @@ index 6a331eb..c226797 100644
+@@ -474,7 +451,7 @@ index 6a331eb..c226797 100644
-#endif
-
-#if CONFIG_MPEG1_VDPAU_DECODER
@@ -102,7 +385,7 @@ diff -upr mplayer-vaapi-20110127.orig/patches/mplayer-vdpau.patch mplayer-vaapi-
- "mpeg1video_vdpau",
- AVMEDIA_TYPE_VIDEO,
- CODEC_ID_MPEG1VIDEO,
-@@ -500,7 +503,7 @@ index b339f78..1928d03 100644
+@@ -500,7 +477,7 @@ index b339f78..1928d03 100644
-
-
-#if CONFIG_MPEG4_VDPAU_DECODER
@@ -111,7 +394,35 @@ diff -upr mplayer-vaapi-20110127.orig/patches/mplayer-vdpau.patch mplayer-vaapi-
- "mpeg4_vdpau",
- AVMEDIA_TYPE_VIDEO,
- CODEC_ID_MPEG4,
-@@ -588,7 +591,7 @@ index c9a547b..71c50e7 100644
+@@ -527,9 +504,17 @@ index 9650066..5f8440b 100644
+ PIX_FMT_NONE
+ };
+ @@ -1064,7 +1065,6 @@ void MPV_frame_end(MpegEncContext *s)
+- if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration){
+ ff_xvmc_field_end(s);
+- }else if(!s->avctx->hwaccel
++ }else if((s->error_count || s->encoding)
++ && !s->avctx->hwaccel
++- && !(s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
++ && s->unrestricted_mv
++ && s->current_picture.reference
++ && !s->intra_only
++@@ -2254,7 +2254,6 @@ void ff_draw_horiz_band(MpegEncContext *
++ }
++
++ if (!s->avctx->hwaccel
+ - && !(s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
+ && s->unrestricted_mv
+ && s->current_picture.reference
+@@ -582,13 +567,13 @@ index c9a547b..71c50e7 100644
+ if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0)
+ return -1;
+ if (avctx->hwaccel->decode_slice(avctx, buf_start, (buf + buf_size) - buf_start) < 0)
+-@@ -3376,37 +3364,3 @@ AVCodec wmv3_decoder = {
+- .pix_fmts = ff_hwaccel_pixfmt_list_420
++@@ -3376,39 +3364,3 @@ AVCodec wmv3_decoder = {
++ .profiles = NULL_IF_CONFIG_SMALL(profiles)
+ };
#endif
-
-#if CONFIG_WMV3_VDPAU_DECODER
@@ -120,7 +431,14 @@ diff -upr mplayer-vaapi-20110127.orig/patches/mplayer-vdpau.patch mplayer-vaapi-
- "wmv3_vdpau",
- AVMEDIA_TYPE_VIDEO,
- CODEC_ID_WMV3,
-@@ -605,7 +608,7 @@ index c9a547b..71c50e7 100644
+@@ -600,12 +585,13 @@ index c9a547b..71c50e7 100644
+ - CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,
+ - NULL,
+ - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 VDPAU"),
+-- .pix_fmts = (const enum PixelFormat[]){PIX_FMT_VDPAU_WMV3, PIX_FMT_NONE}
++- .pix_fmts = (const enum PixelFormat[]){PIX_FMT_VDPAU_WMV3, PIX_FMT_NONE},
++- .profiles = NULL_IF_CONFIG_SMALL(profiles)
+ -};
-#endif
-
-#if CONFIG_VC1_VDPAU_DECODER
@@ -129,3 +447,45 @@ diff -upr mplayer-vaapi-20110127.orig/patches/mplayer-vdpau.patch mplayer-vaapi-
- "vc1_vdpau",
- AVMEDIA_TYPE_VIDEO,
- CODEC_ID_VC1,
+@@ -617,7 +603,8 @@ index c9a547b..71c50e7 100644
+ - CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,
+ - NULL,
+ - .long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1 VDPAU"),
+-- .pix_fmts = (const enum PixelFormat[]){PIX_FMT_VDPAU_VC1, PIX_FMT_NONE}
++- .pix_fmts = (const enum PixelFormat[]){PIX_FMT_VDPAU_VC1, PIX_FMT_NONE},
++- .profiles = NULL_IF_CONFIG_SMALL(profiles)
+ -};
+ -#endif
+ diff --git a/ffmpeg/libavcodec/vdpau.c b/ffmpeg/libavcodec/vdpau.c
+@@ -1163,9 +1150,9 @@ index 8ec91c8..2386a81 100644
+ PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
+ PIX_FMT_Y400A, ///< 8bit gray, 8bit alpha
+ + PIX_FMT_VDPAU, ///< HW decoding with VDPAU, Picture.data[3] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
++ PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
++ PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
+ PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
+- };
+-
+ diff --git a/fmt-conversion.c b/fmt-conversion.c
+ index bd32ce8..8994caa 100644
+ --- a/fmt-conversion.c
+@@ -1198,19 +1185,6 @@ index bd32ce8..8994caa 100644
+ {0, PIX_FMT_NONE}
+ };
+
+-diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
+-index 84b5430..aef79e9 100644
+---- a/libmpcodecs/vd_ffmpeg.c
+-+++ b/libmpcodecs/vd_ffmpeg.c
+-@@ -303,7 +303,7 @@ static int init(sh_video_t *sh){
+- }
+- #endif /* CONFIG_VAAPI */
+- #if CONFIG_VDPAU
+-- if(lavc_codec->capabilities & CODEC_CAP_HWACCEL_VDPAU){
+-+ if(get_video_hwaccel() == HWACCEL_VDPAU){
+- avctx->get_format = get_format;
+- }
+- #endif /* CONFIG_VDPAU */
+ diff --git a/libvo/vo_vdpau.c b/libvo/vo_vdpau.c
+ index 5133b66..0ce6104 100644
+ --- a/libvo/vo_vdpau.c