aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerion Entrup <gerion.entrup@flump.de>2013-07-30 17:43:43 +0200
committerGerion Entrup <gerion.entrup@flump.de>2013-07-30 17:43:43 +0200
commitba84a7616ad5225f77b8174947cf5126258423b1 (patch)
treedf0653e9a12dc98c51f45ffc252388547bfaeb8c /media-sound
parentadd covim ebuild (diff)
downloadgerislay-ba84a7616ad5225f77b8174947cf5126258423b1.tar.gz
gerislay-ba84a7616ad5225f77b8174947cf5126258423b1.tar.bz2
gerislay-ba84a7616ad5225f77b8174947cf5126258423b1.zip
add mplayer with vaapi patch
Diffstat (limited to 'media-sound')
-rw-r--r--media-sound/mplayer/ChangeLog1106
-rw-r--r--media-sound/mplayer/ChangeLog-20082904
-rw-r--r--media-sound/mplayer/Manifest23
-rwxr-xr-xmedia-sound/mplayer/files/dump_ffmpeg.sh75
-rw-r--r--media-sound/mplayer/files/extra/mplayer-coreavc-1.1.patch766
-rw-r--r--media-sound/mplayer/files/extra/mplayer-orderedmkv-1.1-need_fixing.patch703
-rw-r--r--media-sound/mplayer/files/extra/mplayer-stereoscopic-1.1.patch261
-rw-r--r--media-sound/mplayer/files/extra/mplayer-vaapi-1.1.patch3883
-rw-r--r--media-sound/mplayer/files/extra/mplayer-vaapi_for_svn-35034.patch3883
-rw-r--r--media-sound/mplayer/files/ffmpeg.patch17
-rw-r--r--media-sound/mplayer/files/ffmpeg2.patch14
-rw-r--r--media-sound/mplayer/files/mplayer-1.0_rc4-pkg-config.patch74
-rw-r--r--media-sound/mplayer/files/mplayer-1.0_rc4_p20110322-gcc46.patch22
-rw-r--r--media-sound/mplayer/files/mplayer-1.0_rc4_p20110322-sami_subtitle_parsing.patch14
-rw-r--r--media-sound/mplayer/files/mplayer-1.1-codecid.patch19
-rw-r--r--media-sound/mplayer/files/mplayer-1.1-ffmpeg.patch34
-rw-r--r--media-sound/mplayer/files/prepare_mplayer.sh25
-rw-r--r--media-sound/mplayer/metadata.xml53
-rw-r--r--media-sound/mplayer/mplayer-1.1-r1.ebuild664
-rw-r--r--media-sound/mplayer/mplayer-1.1-r2.ebuild698
20 files changed, 15238 insertions, 0 deletions
diff --git a/media-sound/mplayer/ChangeLog b/media-sound/mplayer/ChangeLog
new file mode 100644
index 0000000..df999be
--- /dev/null
+++ b/media-sound/mplayer/ChangeLog
@@ -0,0 +1,1106 @@
+# ChangeLog for media-video/mplayer
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/ChangeLog,v 1.856 2012/08/22 15:24:11 aballier Exp $
+
+ 22 Aug 2012; Alexis Ballier <aballier@gentoo.org> mplayer-1.1-r1.ebuild,
+ +files/mplayer-1.1-codecid.patch:
+ add upstream build fix against ffmpeg git master
+
+ 01 Aug 2012; Fabian Groffen <grobian@gentoo.org> mplayer-1.1-r1.ebuild:
+ aqua is also sufficient for opengl and osdmenu
+
+ 21 Jun 2012; Ben de Groot <yngwin@gentoo.org>
+ mplayer-1.0_rc4_p20120405.ebuild, mplayer-1.1-r1.ebuild, mplayer-9999.ebuild:
+ Fix libass usage, bug #422251
+
+ 17 Jun 2012; Ben de Groot <yngwin@gentoo.org> metadata.xml,
+ mplayer-1.0_rc4_p20110322-r1.ebuild, mplayer-1.0_rc4_p20120213.ebuild,
+ mplayer-1.0_rc4_p20120405.ebuild, mplayer-1.1-r1.ebuild, mplayer-9999.ebuild:
+ Move USE=ass usage to new global libass useflag (bug #328245)
+
+*mplayer-1.1-r1 (11 Jun 2012)
+
+ 11 Jun 2012; Alexis Ballier <aballier@gentoo.org> -mplayer-1.1.ebuild,
+ +mplayer-1.1-r1.ebuild:
+ Push previous changes in a new revision.
+
+ 11 Jun 2012; Alexis Ballier <aballier@gentoo.org> mplayer-1.1.ebuild,
+ +files/mplayer-1.1-ffmpeg.patch, mplayer-9999.ebuild, files/dump_ffmpeg.sh:
+ Do not let it use bundled ffmpeg headers for releasees, bug #420601. Fix
+ build with ffmpeg 0.10.3 with now unbundled headers. Let dump_ffmpeg.sh work
+ with releases tarballs. Bump ffmpeg deps in -9999.
+
+*mplayer-1.1 (10 Jun 2012)
+
+ 10 Jun 2012; Alexis Ballier <aballier@gentoo.org> +mplayer-1.1.ebuild,
+ mplayer-9999.ebuild:
+ version bump and sync with -9999
+
+ 05 May 2012; Jeff Horelick <jdhore@gentoo.org>
+ mplayer-1.0_rc4_p20110322-r1.ebuild, mplayer-1.0_rc4_p20120213.ebuild,
+ mplayer-1.0_rc4_p20120405.ebuild, mplayer-9999.ebuild:
+ dev-util/pkgconfig -> virtual/pkgconfig
+
+ 08 Apr 2012; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc4_p20120213.ebuild, mplayer-1.0_rc4_p20120405.ebuild:
+ Add ~alpha/~arm/~ia64/~sparc wrt #394805
+
+ 05 Apr 2012; Mike Frysinger <vapier@gentoo.org>
+ mplayer-1.0_rc4_p20120405.ebuild, +files/mplayer-1.0_rc4-pkg-config.patch:
+ Fix pkg-config handling with libdvd{nav,read} #410189.
+
+ 05 Apr 2012; Alexis Ballier <aballier@gentoo.org>
+ mplayer-1.0_rc4_p20120405.ebuild, mplayer-9999.ebuild:
+ bump ffmpeg deps: 9999 requires 9999 and ~arch requires 0.10.2
+
+*mplayer-1.0_rc4_p20120405 (05 Apr 2012)
+
+ 05 Apr 2012; Alexis Ballier <aballier@gentoo.org> +files/ffmpeg2.patch,
+ +mplayer-1.0_rc4_p20120405.ebuild:
+ bump a new snapshot
+
+ 18 Mar 2012; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc4_p20110322-r1.ebuild, mplayer-1.0_rc4_p20120213.ebuild,
+ mplayer-9999.ebuild:
+ Remove USE="esd" because media-sound/esound isn't in tree anymore.
+
+ 19 Feb 2012; Alexis Ballier <aballier@gentoo.org>
+ -mplayer-1.0_rc4_p20111215.ebuild, -mplayer-1.0_rc4_p20120105.ebuild,
+ -mplayer-1.0_rc4_p20120109.ebuild, -mplayer-1.0_rc4_p20120128.ebuild,
+ -files/swedish.patch:
+ remove old
+
+ 15 Feb 2012; Joerg Bornkessel <hd_brummy@gentoo.org>
+ mplayer-1.0_rc4_p20110322-r1.ebuild, mplayer-1.0_rc4_p20111215.ebuild,
+ mplayer-1.0_rc4_p20120105.ebuild, mplayer-1.0_rc4_p20120109.ebuild,
+ mplayer-1.0_rc4_p20120128.ebuild, mplayer-1.0_rc4_p20120213.ebuild,
+ mplayer-9999.ebuild:
+ fix media-tv to virtual/linuxtv-dvb-headers, bug #403929
+
+ 13 Feb 2012; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ trunk does not build with ffmpeg 0.10, bump dep
+
+ 13 Feb 2012; Alexis Ballier <aballier@gentoo.org> metadata.xml:
+ typos in real use flag description, bug #400963
+
+*mplayer-1.0_rc4_p20120213 (13 Feb 2012)
+
+ 13 Feb 2012; Alexis Ballier <aballier@gentoo.org>
+ +mplayer-1.0_rc4_p20120213.ebuild, +files/ffmpeg.patch:
+ bump a new snapshot, should fix bugs #402235 and #401315
+
+ 05 Feb 2012; Thomas Kahle <tomka@gentoo.org>
+ mplayer-1.0_rc4_p20120128.ebuild:
+ marked ~x86 per bug 394805
+
+*mplayer-1.0_rc4_p20120128 (28 Jan 2012)
+
+ 28 Jan 2012; Alexis Ballier <aballier@gentoo.org>
+ +mplayer-1.0_rc4_p20120128.ebuild, mplayer-9999.ebuild:
+ bump a new snapshot for ffmpeg 0.10
+
+*mplayer-1.0_rc4_p20120109 (09 Jan 2012)
+
+ 09 Jan 2012; Alexis Ballier <aballier@gentoo.org>
+ +mplayer-1.0_rc4_p20120109.ebuild:
+ bump a new snapshot that should fix bug #397789
+
+*mplayer-1.0_rc4_p20120105 (05 Jan 2012)
+
+ 05 Jan 2012; Alexis Ballier <aballier@gentoo.org>
+ +mplayer-1.0_rc4_p20120105.ebuild:
+ bump a new snapshot with accumulated fixes from 9999, working with ffmpeg
+ 0.9.1 release
+
+ 02 Jan 2012; Andreas K. Huettel <dilfridge@gentoo.org> +ChangeLog-2008:
+ Split ChangeLog.
+
+ 22 Dec 2011; Alexis Ballier <aballier@gentoo.org> files/swedish.patch:
+ add a note that patch has been applied upstream
+
+ 22 Dec 2011; Alexis Ballier <aballier@gentoo.org>
+ mplayer-1.0_rc4_p20111215.ebuild, +files/swedish.patch:
+ fix build of swedish help, by larkang@gmail.com, bug #395677
+
+ 19 Dec 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ improve a warning
+
+ 19 Dec 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ dvdnav requires dvd, no need to protect the deps
+
+ 19 Dec 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ Simplify X checks in ebuild: use REQUIRED_USE instead of silently disabling
+ features, people enabling X related features should know they will require X.
+ Remove video_cards_vesa useflag that does nothing.
+
+ 19 Dec 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ some new formats have been added after ffmpeg 0.9 which mplayer trunk now
+ requires, bump ffmpeg dep
+
+ 18 Dec 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ mp3lib failed to build on x86 with -O0 and frame-pointer, since we dropped
+ internal mp3lib we can also avoid messing with CFLAGS and let people build
+ with the -O flag they wish.
+
+ 18 Dec 2011; Alexis Ballier <aballier@gentoo.org> files/dump_ffmpeg.sh:
+ allfilters.c is also checked, inlude it too
+
+ 17 Dec 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ cosmetics
+
+ 17 Dec 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ dvdnav requires dvd, simplifying ebuild
+
+ 17 Dec 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ reflect some inter use flag dependencies by REQUIRED_USE
+
+ 17 Dec 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ cosmetics
+
+ 17 Dec 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ remove custom-cpuopts option: if anything breaks the build we can disallow it
+ with REQUIRED_USE
+
+ 17 Dec 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ remove dead code: faac + bindist is disallowed by REQUIRED_USE
+
+ 17 Dec 2011; Alexis Ballier <aballier@gentoo.org>
+ mplayer-1.0_rc4_p20111215.ebuild, mplayer-9999.ebuild:
+ fix build with USE=doc, by Martin von Gagern in bug #394907
+
+ 16 Dec 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ use libmpg123 for mp3 decoding and remove internal mp3lib, bug #384849 by
+ Samuli Suominen
+
+ 16 Dec 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ generate on the fly a snapshot version for live ebuilds and use that file for
+ generating a VERSION file that advertises it is a Gentoo build as suggested
+ by Reimar Döffinger in bug #328817
+
+ 16 Dec 2011; Alexis Ballier <aballier@gentoo.org> files/prepare_mplayer.sh:
+ generate snapshot_version the same way as upstream version.sh and use printf
+ which should be more portable
+
+ 16 Dec 2011; Alexis Ballier <aballier@gentoo.org> files/prepare_mplayer.sh:
+ create a snapshot_version file in snapshots to get svn revision
+
+ 16 Dec 2011; Alexis Ballier <aballier@gentoo.org>
+ mplayer-1.0_rc4_p20111215.ebuild, mplayer-9999.ebuild:
+ bump libbluray dep, bug #387935
+
+ 15 Dec 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ sync with snapshot
+
+*mplayer-1.0_rc4_p20111215 (15 Dec 2011)
+
+ 15 Dec 2011; Alexis Ballier <aballier@gentoo.org>
+ +mplayer-1.0_rc4_p20111215.ebuild:
+ bump a new snapshot using system ffmpeg
+
+ 15 Dec 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ depend on ffmpeg 0.9, bug #392405
+
+ 15 Dec 2011; Alexis Ballier <aballier@gentoo.org> files/prepare_mplayer.sh:
+ update the prepare_mplayer script to use ffmpeg instead of libav and use
+ dump_ffmpeg.sh for dumping unused files
+
+ 02 Nov 2011; Alexis Ballier <aballier@gentoo.org> files/dump_ffmpeg.sh:
+ riff.h isnt needed anymore
+
+ 31 Oct 2011; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc4_p20110322-r1.ebuild, mplayer-9999.ebuild:
+ Rename USE="v4l2" to USE="v4l" while removing support for video4linux 1.x wrt
+ #385241
+
+ 15 Oct 2011; Tim Harder <radhermit@gentoo.org>
+ -mplayer-1.0_rc4_p20101114.ebuild, -mplayer-1.0_rc4_p20110322.ebuild:
+ Remove old, insecure versions.
+
+ 12 Oct 2011; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc4_p20110322-r1.ebuild:
+ alpha/ia64/sparc stable wrt #379297
+
+ 09 Oct 2011; Kacper Kowalik <xarthisius@gentoo.org>
+ mplayer-1.0_rc4_p20110322-r1.ebuild:
+ ppc/ppc64 stable wrt #379297
+
+ 09 Oct 2011; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc4_p20110322-r1.ebuild:
+ Stable for HPPA (bug #379297).
+
+ 09 Oct 2011; Markus Meier <maekke@gentoo.org>
+ mplayer-1.0_rc4_p20110322-r1.ebuild:
+ arm stable, bug #379297
+
+ 08 Oct 2011; Pawel Hajdan jr <phajdan.jr@gentoo.org>
+ mplayer-1.0_rc4_p20110322-r1.ebuild:
+ x86 stable wrt security bug #379297
+
+ 06 Oct 2011; Steve Dibb <beandog@gentoo.org>
+ mplayer-1.0_rc4_p20110322-r1.ebuild:
+ amd64 stable, security bug 379297
+
+*mplayer-1.0_rc4_p20110322-r1 (06 Oct 2011)
+
+ 06 Oct 2011; Samuli Suominen <ssuominen@gentoo.org>
+ +mplayer-1.0_rc4_p20110322-r1.ebuild,
+ +files/mplayer-1.0_rc4_p20110322-sami_subtitle_parsing.patch:
+ Fix security bug (SAMI Subtitle Parsing Buffer Overflow) #379297 by Agostino
+ Sarubbo
+
+ 24 Sep 2011; Matt Turner <mattst88@gentoo.org>
+ mplayer-1.0_rc4_p20110322.ebuild,
+ +files/mplayer-1.0_rc4_p20110322-gcc46.patch:
+ Add patch to work-around high pitched sounds produced when compiled with
+ gcc-4.6, bug 377837
+
+ 15 Jul 2011; Matt Turner <mattst88@gentoo.org>
+ mplayer-1.0_rc4_p20110322.ebuild:
+ Added ~mips, bug 304931
+
+ 08 Jul 2011; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc4_p20101114.ebuild, mplayer-1.0_rc4_p20110322.ebuild,
+ mplayer-9999.ebuild:
+ Convert from "hasq" to "has".
+
+ 23 Jun 2011; Alexis Ballier <aballier@gentoo.org>
+ -mplayer-1.0_rc4_p20091026-r1.ebuild,
+ -files/mplayer-1.0_rc4_p20091026-arm_neon.patch:
+ remove old
+
+ 23 Jun 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ use git-2.eclass for ffmpeg
+
+ 23 Jun 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ do not default enable faac, its non free, not compatible with binary
+ distribution, and ffmpeg has an encoder now
+
+ 08 Jun 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ fix variable quoting
+
+ 08 Jun 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ remove useless CFLAGS variable assignment
+
+ 08 Jun 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild,
+ +files/dump_ffmpeg.sh, metadata.xml:
+ Always use system ffmpeg, use only the required internal headers from ffmpeg,
+ bug #361731
+
+ 22 May 2011; Joseph Jezak <josejx@gentoo.org>
+ mplayer-1.0_rc4_p20101114.ebuild:
+ Marked ppc stable for bug #343977.
+
+ 03 Apr 2011; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild:
+ Set egit project properly.
+
+ 03 Apr 2011; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild:
+ Drop useless egit_project definition
+
+ 26 Mar 2011; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild:
+ Depend on virtual/ffmpeg
+
+ 22 Mar 2011; Tomáš Chvátal <scarabeus@gentoo.org>
+ mplayer-1.0_rc4_p20110322.ebuild, mplayer-9999.ebuild:
+ Revert required use usage.
+
+*mplayer-1.0_rc4_p20110322 (22 Mar 2011)
+
+ 22 Mar 2011; Tomáš Chvátal <scarabeus@gentoo.org>
+ -mplayer-1.0_rc4_p20101219.ebuild, -mplayer-1.0_rc4_p20110302.ebuild,
+ +mplayer-1.0_rc4_p20110322.ebuild, mplayer-9999.ebuild,
+ files/prepare_mplayer.sh:
+ Add new snapshot (update snapshot creator to use libav).
+
+ 20 Mar 2011; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild,
+ files/prepare_mplayer.sh:
+ Move to use libav in live mplayer ebuild and snapshot preparator.
+
+ 20 Mar 2011; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc4_p20101114.ebuild:
+ arm/ia64/sparc stable wrt #343977
+
+ 06 Mar 2011; Kacper Kowalik <xarthisius@gentoo.org>
+ mplayer-1.0_rc4_p20101114.ebuild:
+ ppc64 stable wrt #343977
+
+*mplayer-1.0_rc4_p20110302 (02 Mar 2011)
+
+ 02 Mar 2011; Tomáš Chvátal <scarabeus@gentoo.org>
+ +mplayer-1.0_rc4_p20110302.ebuild, mplayer-9999.ebuild,
+ files/prepare_mplayer.sh:
+ Add new snapshot so we have something matching to latest release. Cleanup
+ src_install a bit.
+
+ 01 Mar 2011; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild:
+ Update ebuild per bug #354023 and #354625. Thanks to reporters for patches.
+
+ 30 Jan 2011; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild:
+ Clone the ffmpeg from git as svn external was removed.
+
+ 30 Jan 2011; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild:
+ Update live verison to eapi4 and use_required syntax. Fix default
+ configuration section, some settings were eaten for me otherwise.
+
+ 30 Jan 2011; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild:
+ Fix dependency on vdpau (it specificaly check for headers in libvdpau). Per
+ bug #352422.
+
+ 26 Jan 2011; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc4_p20101114.ebuild:
+ Stable for HPPA (bug #343977).
+
+ 22 Jan 2011; Markos Chandras <hwoarang@gentoo.org>
+ mplayer-1.0_rc4_p20101114.ebuild:
+ Stable on amd64 wrt bug #343977
+
+ 22 Jan 2011; Christian Faulhammer <fauli@gentoo.org>
+ mplayer-1.0_rc4_p20101114.ebuild:
+ stable x86, bug 343977
+
+ 14 Jan 2011; Fabian Groffen <grobian@gentoo.org> mplayer-9999.ebuild:
+ Simplify and generalise too few registers logic for all x86 hosts, bug
+ #351588
+
+ 02 Jan 2011; Tobias Klausmann <klausman@gentoo.org>
+ mplayer-1.0_rc4_p20101114.ebuild:
+ Stable on alpha, bug #343977
+
+ 02 Jan 2011; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ The internal copy of faad2 is gone, bug #350316
+
+*mplayer-1.0_rc4_p20101219 (19 Dec 2010)
+
+ 19 Dec 2010; Tomáš Chvátal <scarabeus@gentoo.org>
+ -mplayer-1.0_rc4_p20100506.ebuild, -mplayer-1.0_rc4_p20100612.ebuild,
+ -mplayer-1.0_rc4_p20101107.ebuild, +mplayer-1.0_rc4_p20101219.ebuild,
+ mplayer-9999.ebuild:
+ Version bump (add new snapshot that should fix vorbis failiture). Drop old.
+ Sort keywords in live ebuild.
+
+*mplayer-1.0_rc4_p20101114 (14 Nov 2010)
+
+ 14 Nov 2010; Lars Wendler <polynomial-c@gentoo.org>
+ +mplayer-1.0_rc4_p20101114.ebuild:
+ non-maintainer commit: New snapshot to fix bug #345155. Permission kindly
+ granted by scarabeus.
+
+ 07 Nov 2010; Alexis Ballier <aballier@gentoo.org> metadata.xml:
+ update description of the vpx useflag, bug #337690
+
+ 07 Nov 2010; Jory A. Pratt <anarchy@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild, mplayer-1.0_rc4_p20100506.ebuild,
+ mplayer-1.0_rc4_p20100612.ebuild, mplayer-1.0_rc4_p20101107.ebuild,
+ mplayer-9999.ebuild:
+ Convert media-libs/jpeg to virtual/jpeg
+
+*mplayer-1.0_rc4_p20101107 (07 Nov 2010)
+
+ 07 Nov 2010; Tomáš Chvátal <scarabeus@gentoo.org>
+ +mplayer-1.0_rc4_p20101107.ebuild, mplayer-9999.ebuild,
+ +files/prepare_mplayer.sh:
+ Add new snapshot and add tool that create them to files/
+
+ 01 Nov 2010; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild,
+ metadata.xml:
+ Fix mga videocard check per bug #341171. Add missing options per bug #334793.
+
+ 10 Oct 2010; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild,
+ metadata.xml:
+ Replace rtmpdump with rtmp useflag. As is done in ffmpeg and xbmc.
+
+ 10 Oct 2010; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild:
+ EAPI3fy for prefix support.
+
+ 10 Oct 2010; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild:
+ Introduce gsm useflag. Adds support for the gsm lossy speech compression
+ codec.
+
+ 10 Oct 2010; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild:
+ Always disable internal libmpeg2.
+
+ 10 Oct 2010; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild,
+ metadata.xml:
+ Ebuild cleanup. Drop gmplayer useflag. Introduce rtmpdump useflag. Thanks
+ to Andrew Savchenko. Fixes bug #336021 and bug #337284.
+
+ 01 Oct 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ fix configure options for external ffmpeg
+
+ 18 Jul 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ network configure option has been renamed to networking
+
+ 17 Jul 2010; Steve Dibb <beandog@gentoo.org> mplayer-9999.ebuild:
+ Revert libass change; Always use external versions where possible
+
+ 17 Jul 2010; Steve Dibb <beandog@gentoo.org> mplayer-9999.ebuild,
+ metadata.xml:
+ Add support for external libass libraries, bug 327733
+
+ 17 Jul 2010; Steve Dibb <beandog@gentoo.org> mplayer-9999.ebuild:
+ Add bluray use flag for playback through libbluray
+
+ 30 Jun 2010; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild:
+ Drop svga useflag.
+
+ 30 Jun 2010; Fabio Erculiani <lxnay@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild, mplayer-1.0_rc4_p20100506.ebuild,
+ mplayer-1.0_rc4_p20100612.ebuild, mplayer-9999.ebuild:
+ fix automagic dependency against svgalib, add --disable-svgalib
+ --disable-svgalib_helper
+
+ 27 Jun 2010; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc4_p20100612.ebuild:
+ Re-add ~alpha/~arm/~ia64/~sparc
+
+ 25 Jun 2010; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc4_p20100612.ebuild, mplayer-9999.ebuild:
+ Missing gcc-specs-pie check wrt #325517 by Toralf Förster and Magnus
+ Granberg.
+
+ 25 Jun 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ propagate enca useflag to libass, by Alexey Shildyakov
+ <ashl1future@gmail.com>, bug #321863
+
+ 25 Jun 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ disable faac with use bindist, by Nikoli <nikoli@lavabit.com>, bug #323353
+
+ 13 Jun 2010; Dror Levin <spatz@gentoo.org>
+ mplayer-1.0_rc4_p20100612.ebuild:
+ Dropping keywords pending keywording of media-libs/libvpx, bug 323727.
+
+*mplayer-1.0_rc4_p20100612 (12 Jun 2010)
+
+ 12 Jun 2010; Dror Levin <spatz@gentoo.org>
+ +mplayer-1.0_rc4_p20100612.ebuild:
+ Roll new snapshot with VP8 support.
+
+ 12 Jun 2010; Dror Levin <spatz@gentoo.org> mplayer-9999.ebuild,
+ metadata.xml:
+ Add vpx support via media-libs/libvpx.
+
+ 11 Jun 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ fix the configure options building with mencoder disabled, bug #323097
+
+ 02 Jun 2010; Luca Barbato <lu_zero@gentoo.org> mplayer-9999.ebuild:
+ Ebuild improvements from Nikoli <nikoli@lavabit.com> see bug #322377
+
+ 01 Jun 2010; Luca Barbato <lu_zero@gentoo.org> mplayer-9999.ebuild:
+ Change doc deps as reported in bug #317559
+
+ 31 May 2010; Luca Barbato <lu_zero@gentoo.org> mplayer-9999.ebuild:
+ make sure sed line is safe as suggested by Nikoli on #gentoo-media
+
+ 20 May 2010; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc4_p20100506.ebuild:
+ Marked ~hppa (bug #317459).
+
+ 19 May 2010; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc4_p20100506.ebuild:
+ Readd ~ia64 wrt #317459
+
+ 09 May 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ internal a52dec support has been dropped, use external one
+
+*mplayer-1.0_rc4_p20100506 (06 May 2010)
+
+ 06 May 2010; Tomáš Chvátal <scarabeus@gentoo.org>
+ -files/mplayer-1.0_rc2_p20090322-fix-undeclared-spudec.patch,
+ -files/mplayer-1.0_rc2_p20090530-fix-mp3lib-use-local-labels-2.patch,
+ -files/mplayer-1.0_rc2_p20090731-linguas.patch,
+ -mplayer-1.0_rc4_p20100213-r1.ebuild, -mplayer-1.0_rc4_p20100427.ebuild,
+ +mplayer-1.0_rc4_p20100506.ebuild,
+ -files/mplayer-1.0_rc4_p20091124-r1-libtheora.patch:
+ Rollup new snapshot. Drop old. This should be stable candidate.
+
+ 05 May 2010; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild:
+ Remove emake call from src_compile, is already run by base eclass.
+
+ 01 May 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ iconv should be in RDEPEND too
+
+ 01 May 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ Add missing dep on app-text/docbook-xml-dtd by Scott Burgess
+ <scottburgess@diamondkey.com>, bug #317559
+
+ 29 Apr 2010; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc4_p20100427.ebuild, mplayer-9999.ebuild:
+ Fix liba52 handling wrt #317797 by Simone Scanzoni.
+
+ 28 Apr 2010; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc4_p20100427.ebuild, mplayer-9999.ebuild:
+ Revert SRC_URI change for svgalib_helper; mirrors still ship the broken
+ copy.
+
+*mplayer-1.0_rc4_p20100427 (27 Apr 2010)
+
+ 27 Apr 2010; Samuli Suominen <ssuominen@gentoo.org>
+ +mplayer-1.0_rc4_p20100427.ebuild:
+ Version (snapshot) bump.
+
+ 24 Apr 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ fix x264 deps
+
+ 24 Apr 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ drop now unneeded append-flags
+
+ 24 Apr 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ Build and install html documentation into the correct location, based on
+ the LINGUAS variable, from on a patch by Andrew Savchenko in bug #299405
+
+ 24 Apr 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ dont depend on cdparanoia if cdio is enabled, we wont use it; patch by
+ Andrew Savchenko, bug #299405
+
+ 24 Apr 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ remove aac useflag: let faad and faac useflags handle it; otherwise there
+ is support in ffmpeg; always use system libfaad
+
+ 24 Apr 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ Disable opencore-amr support with bindist, Apache-2.0 vs GPL-2 issues,
+ https://bugs.gentoo.org/show_bug.cgi?id=299405#c6
+
+ 24 Apr 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ allow ass and truetype without X, by Andrew Savchenko, bug #299405
+
+ 24 Apr 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ use system libass, require freetype 2.2.1 at least
+
+ 24 Apr 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ fix opencore-amr automagic dep
+
+ 24 Apr 2010; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ Fix codecsdir handling; default to real ones, the default can be overriden
+ with codecpath=somewhere in cli or config file, bug #310389 and bug
+ #309931
+
+ 23 Apr 2010; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild, mplayer-1.0_rc4_p20100213-r1.ebuild,
+ mplayer-9999.ebuild, metadata.xml:
+ Rename USE opencore-amr to amr.
+
+ 07 Apr 2010; Tomáš Chvátal <scarabeus@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild, mplayer-1.0_rc4_p20100213-r1.ebuild,
+ mplayer-9999.ebuild:
+ Drop unrar-gpl dep. Since it is useless.
+
+ 26 Mar 2010; Dror Levin <spatz@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild, mplayer-1.0_rc4_p20100213-r1.ebuild,
+ mplayer-9999.ebuild:
+ Convert font deps to virtual/ttf-fonts wrt bug 282754.
+
+ 26 Mar 2010; Dror Levin <spatz@gentoo.org> mplayer-9999.ebuild:
+ Remove dvbhead configure argument, bug 307951.
+
+ 15 Mar 2010; Fabio Erculiani <lxnay@gentoo.org>
+ mplayer-1.0_rc4_p20100213-r1.ebuild, mplayer-9999.ebuild:
+ fine tune USE="vdpau" dependencies
+
+ 15 Mar 2010; Fabio Erculiani <lxnay@gentoo.org>
+ mplayer-1.0_rc4_p20100213-r1.ebuild, mplayer-9999.ebuild:
+ there is no need to depend against x11-drivers/nvidia-drivers for
+ USE="vdpau", x11-libs/libvdpau is enough
+
+ 09 Mar 2010; Steve Dibb <beandog@gentoo.org> mplayer-9999.ebuild:
+ Drop dvbhead argument, bug 307951
+
+ 02 Mar 2010; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc4_p20100213-r1.ebuild, mplayer-9999.ebuild:
+ Append -nopie to LDFLAGS wrt #93862 and only filter -fPIC -fPIE on x86.
+
+*mplayer-1.0_rc4_p20100213-r1 (27 Feb 2010)
+
+ 27 Feb 2010; Sebastian Pipping <sping@gentoo.org>
+ -mplayer-1.0_rc4_p20100213.ebuild, +mplayer-1.0_rc4_p20100213-r1.ebuild,
+ mplayer-9999.ebuild:
+ Fix bug #307039:
+ - Add missing build dep dev-util/pkgconfig
+ - Fix "for i in uses; do" (should be ${uses})
+
+ 26 Feb 2010; Sebastian Pipping <sping@gentoo.org>
+ mplayer-1.0_rc4_p20100213.ebuild, mplayer-9999.ebuild:
+ Restore lost dependencies (bug #287993)
+ - opencore-amr? ( media-libs/opencore-amr )
+ - bs2b? ( media-libs/libbs2b )
+
+ 26 Feb 2010; Sebastian Pipping <sping@gentoo.org> mplayer-9999.ebuild:
+ Copy latest to 9999 before proceeding
+
+ 13 Feb 2010; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc4_p20100213.ebuild, metadata.xml:
+ Rename local USE flag openjpeg to global USE flag jpeg2k.
+
+*mplayer-1.0_rc4_p20100213 (13 Feb 2010)
+
+ 13 Feb 2010; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc4_p20100213.ebuild, metadata.xml:
+ Snapshot bump; Add OpenJPEG support; Drop ~mips due to openjpeg lib, bug
+ 304931
+
+ 11 Feb 2010; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc2_p20090731.ebuild:
+ Remove mips keyword wrt #280281.
+
+ 02 Feb 2010; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild:
+ Add arm to 9999 ebuild too.
+
+ 01 Feb 2010; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild, mplayer-1.0_rc4_p20091124-r1.ebuild:
+ Add ~arm
+
+ 31 Jan 2010; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild,
+ +files/mplayer-1.0_rc4_p20091026-arm_neon.patch:
+ Fix building with ARM NEON wrt #302073 by Raúl Porcel.
+
+ 31 Jan 2010; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild:
+ alpha/ia64/sparc stable
+
+ 24 Jan 2010; Tobias Klausmann <klausman@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild:
+ Stable on alpha, bug #297846
+
+ 09 Jan 2010; Christian Faulhammer <fauli@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild:
+ stable x86, bug 297846
+
+ 07 Jan 2010; Brent Baude <ranger@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild:
+ Marking mplayer-1.0_rc4_p20091026-r1 ppc for bug 297846
+
+ 06 Jan 2010; Brent Baude <ranger@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild:
+ Marking mplayer-1.0_rc4_p20091026-r1 ppc64 for bug 297846
+
+ 03 Jan 2010; Tomáš Chvátal <scarabeus@gentoo.org>
+ mplayer-1.0_rc4_p20091124-r1.ebuild, mplayer-9999.ebuild:
+ Drop epatch_user call, will be handled by new base eclass.
+
+ 25 Dec 2009; Tomáš Chvátal <scarabeus@gentoo.org>
+ mplayer-1.0_rc4_p20091124-r1.ebuild, mplayer-9999.ebuild:
+ Add support for epatch_user.
+
+ 24 Dec 2009; Tomáš Chvátal <scarabeus@gentoo.org>
+ mplayer-1.0_rc4_p20091124-r1.ebuild, mplayer-9999.ebuild:
+ Fix variable usage (${x} -> ${i})
+
+ 24 Dec 2009; Tomáš Chvátal <scarabeus@gentoo.org>
+ mplayer-1.0_rc4_p20091124-r1.ebuild, mplayer-9999.ebuild:
+ Try to simplify the ebuild even bit more.
+
+ 23 Dec 2009; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild:
+ Stable for HPPA (bug #297846).
+
+ 23 Dec 2009; Tomáš Chvátal <scarabeus@gentoo.org>
+ mplayer-1.0_rc4_p20091124-r1.ebuild, mplayer-9999.ebuild:
+ Update live ebuild, sync with latest snapshot.
+ Now latest snapshot and 9999 are 1:1, try to keep it up
+ by changing both ebuilds at once. More prefferably the live
+ ebuild to have the change as first one.
+
+ 22 Dec 2009; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild:
+ amd64 stable wrt #297846
+
+*mplayer-1.0_rc4_p20091124-r1 (26 Nov 2009)
+
+ 26 Nov 2009; Steve Dibb <beandog@gentoo.org>
+ -mplayer-1.0_rc4_p20091124.ebuild, +mplayer-1.0_rc4_p20091124-r1.ebuild,
+ +files/mplayer-1.0_rc4_p20091124-r1-libtheora.patch:
+ Fix x264 dep; add patch to build against libtheora-1.0; bug 294496
+
+*mplayer-1.0_rc4_p20091124 (24 Nov 2009)
+
+ 24 Nov 2009; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc4_p20091124.ebuild:
+ Snapshot bump
+
+ 19 Nov 2009; Steve Dibb <beandog@gentoo.org> mplayer-9999.ebuild:
+ Remove teletext support, bug 292792
+
+ 18 Nov 2009; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc4_p20091026.ebuild, mplayer-1.0_rc4_p20091026-r1.ebuild:
+ Re-add ~ia64/~sparc wrt #280281
+
+ 18 Nov 2009; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild:
+ Marked ~hppa (bug #280281).
+
+ 08 Nov 2009; Tobias Klausmann <klausman@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild:
+ Keyworded on alpha, bug #280281
+
+ 27 Oct 2009; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc4_p20091026-r1.ebuild:
+ If no -O flag is specified, append-flags -O2 (to gain -fomit-frame-pointer
+ by gcc) wrt #288918
+
+*mplayer-1.0_rc4_p20091026-r1 (27 Oct 2009)
+
+ 27 Oct 2009; Samuli Suominen <ssuominen@gentoo.org>
+ +mplayer-1.0_rc4_p20091026-r1.ebuild, metadata.xml:
+ Fix missing media-libs/libbs2b depend wrt #287993, thanks to Sebastian
+ Pipping for reporting. Also, missing media-sound/toolame handling.
+
+*mplayer-1.0_rc4_p20091026 (26 Oct 2009)
+
+ 26 Oct 2009; Samuli Suominen <ssuominen@gentoo.org>
+ +mplayer-1.0_rc4_p20091026.ebuild:
+ Version bump.
+
+ 11 Oct 2009; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc2_p20090322.ebuild:
+ Remove amrnb, amrwb support wrt #252140. Remove arts support wrt #270575.
+ Remove libmpcdec support wrt #279069.
+
+ 25 Sep 2009; Mounir Lamouri <volkmar@gentoo.org>
+ mplayer-1.0_rc4_p20090919-r2.ebuild:
+ Keywording for ppc. Bug 280281
+
+*mplayer-1.0_rc4_p20090919-r2 (25 Sep 2009)
+
+ 25 Sep 2009; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc4_p20090919-r2.ebuild:
+ Only use replace-flags on gcc-4.4+; fix svn revision; less strict on sdl
+ use flag
+
+ 24 Sep 2009; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc2_p20090731-r1.ebuild, mplayer-1.0_rc4_p20090919-r1.ebuild:
+ Re-add ~ia64 wrt #280281
+
+ 22 Sep 2009; Jeremy Olexa <darkside@gentoo.org>
+ mplayer-1.0_rc4_p20090919-r1.ebuild:
+ Fix configure call, just a typo in the ebuild. bug 285894
+
+*mplayer-1.0_rc4_p20090919-r1 (19 Sep 2009)
+
+ 19 Sep 2009; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc4_p20090919-r1.ebuild:
+ Snapshot version bump; Wrap all X dependencies under X use flag, bug
+ 222627 (thanks to William Hubbs for major patch); Drop vesa support, bug
+ 283246; Drop custom-cflags due to gcc-4 bug, filter flags, bug 269975
+
+ 31 Aug 2009; Brent Baude <ranger@gentoo.org>
+ mplayer-1.0_rc2_p20090731-r1.ebuild:
+ Marking mplayer-1.0_rc2_p20090731-r1 ~ppc64 for bug 280281
+
+ 28 Aug 2009; Tobias Klausmann <klausman@gentoo.org>
+ mplayer-1.0_rc2_p20090731-r1.ebuild:
+ Keyworded on alpha, bug #280281
+
+ 19 Aug 2009; Christian Faulhammer <fauli@gentoo.org>
+ mplayer-1.0_rc2_p20090731-r1.ebuild:
+ add ~x86, bug 280281
+
+ 09 Aug 2009; nixnut <nixnut@gentoo.org> mplayer-1.0_rc2_p20090731.ebuild:
+ ppc stable #279342
+
+ 08 Aug 2009; Brent Baude <ranger@gentoo.org>
+ mplayer-1.0_rc2_p20090731.ebuild:
+ Marking mplayer-1.0_rc2_p20090731 ppc64 for bug 279342
+
+ 04 Aug 2009; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc2_p20090731-r1.ebuild:
+ Marked ~hppa (bug #280281).
+
+*mplayer-1.0_rc2_p20090731-r1 (04 Aug 2009)
+
+ 04 Aug 2009; Samuli Suominen <ssuominen@gentoo.org>
+ +mplayer-1.0_rc2_p20090731-r1.ebuild, metadata.xml:
+ Raise x264 depend wrt #240347. Fix automagic opencore-amr depend wrt
+ #279995.
+
+ 03 Aug 2009; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc2_p20090731.ebuild:
+ Pull in dejavu or ttf-bitstream-vera with USE ass wrt #263185.
+
+ 03 Aug 2009; Markus Meier <maekke@gentoo.org>
+ mplayer-1.0_rc2_p20090731.ebuild:
+ x86 stable, bug #279342
+
+ 03 Aug 2009; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc2_p20090731.ebuild:
+ Remove USE nemesi since it's not in tree anymore wrt #274807.
+
+ 03 Aug 2009; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc2_p20090322.ebuild, mplayer-1.0_rc2_p20090530.ebuild,
+ mplayer-1.0_rc2_p20090731.ebuild:
+ Upload svgalib_helper again to mirrors wrt #279883.
+
+ 03 Aug 2009; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc2_p20090731.ebuild,
+ +files/mplayer-1.0_rc2_p20090731-linguas.patch:
+ Fix LINGUAS handling wrt #280129.
+
+ 03 Aug 2009; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild:
+ Use tr instead of sed for creating the linguas list, this fixes a build
+ issue when LINGUAS contains more than two languages.
+
+ 03 Aug 2009; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc2_p20090731.ebuild:
+ Stable for HPPA (bug #279342).
+
+ 02 Aug 2009; <chainsaw@gentoo.org> mplayer-1.0_rc2_p20090731.ebuild:
+ Marked stable on AMD64 for security bug #279342 filed by Alex Legler
+ <a3li@gentoo.org>. Tested with fullscreen XV playback of XviD content on a
+ Radeon X600, dual hex-core Opteron system with USE="3dnow 3dnowext X a52
+ aac aalib alsa ass cddb cdio cdparanoia dirac dts dv dvd dvdnav enca
+ encode faac faad fbcon ftp gif iconv ipv6 jpeg libcaca live lzo mad md5sum
+ mmx mmxext mng mp2 mp3 nemesi network opengl osdmenu png pnm pulseaudio
+ quicktime rar real rtc schroedinger sdl shm speex sse sse2 ssse3 theora
+ tremor truetype unicode v4l2 vorbis x264 xinerama xv xvid xvmc (-altivec)
+ -bidi -bindist -bl -cpudetection -custom-cflags -custom-cpuopts -debug
+ -dga -directfb -doc -dvb -dxr3 -esd -ggi -gmplayer -jack -joystick -ladspa
+ -lirc -nas -nut -openal -oss -pvr -radio -samba (-svga) -teletext -tga
+ -v4l -vdpau (-vidix) (-win32codecs) -xanim -xscreensaver -zoran".
+
+ 01 Aug 2009; Diego E. Pettenò <flameeyes@gentoo.org>
+ mplayer-1.0_rc2_p20090731.ebuild:
+ Restore the local labels patch. Sigh.
+
+ 31 Jul 2009; <chainsaw@gentoo.org> mplayer-1.0_rc2_p20090530.ebuild:
+ Marked stable on AMD64 as requested by Samuli Suominen
+ <ssuominen@gentoo.org> in bug #279826. Tested using full-screen XV
+ playback of XViD content on a Radeon X600; USE="3dnow 3dnowext X a52 aac
+ aalib alsa amrnb amrwb ass cddb cdio cdparanoia dirac dts dv dvd dvdnav
+ enca encode faac faad fbcon ftp gif iconv ipv6 jpeg libcaca live lzo mad
+ md5sum mmx mmxext mng mp2 mp3 nemesi network opengl osdmenu png pnm
+ pulseaudio quicktime rar rtc schroedinger sdl shm speex sse sse2 ssse3
+ theora tremor truetype unicode v4l2 vorbis x264 xinerama xv xvid xvmc
+ (-altivec) -bidi -bindist -bl -cpudetection -custom-cflags -custom-cpuopts
+ -debug -dga -directfb -doc -dvb -dxr3 -esd -ggi -gmplayer -jack -joystick
+ -ladspa -lirc -nas -nut -openal -oss -pvr -radio (-real) -samba (-svga)
+ -teletext -tga -v4l -vdpau (-vidix) (-win32codecs) -xanim -xscreensaver
+ -zoran".
+
+*mplayer-1.0_rc2_p20090731 (31 Jul 2009)
+
+ 31 Jul 2009; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p20090731.ebuild, mplayer-9999.ebuild:
+ Snapshot bump, add --language* options to check for correct LINGUAS
+ variable to use for messages, documentation
+
+ 27 Jul 2009; Alexis Ballier <aballier@gentoo.org> mplayer-9999.ebuild,
+ metadata.xml:
+ Add an option to link against system shared ffmpeg instead of building its
+ own copy and statically linking to it. Saves around 40Mb here but is
+ discouraged by upstream.
+
+ 26 Jul 2009; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc2_p20090530.ebuild, mplayer-9999.ebuild:
+ Remove USE musepack since ffmpeg offers internal codecs for SV7 and SV8
+ support.
+
+ 24 Jul 2009; Steve Dibb <beandog@gentoo.org> mplayer-9999.ebuild:
+ Drop support for old AMR libs
+
+ 04 Jul 2009; Brent Baude <ranger@gentoo.org>
+ mplayer-1.0_rc2_p20090322.ebuild:
+ stable ppc64, bug 272646
+
+ 30 Jun 2009; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc2_p20090322.ebuild:
+ ia64/sparc stable wrt #272646
+
+ 21 Jun 2009; Steve Dibb <beandog@gentoo.org>
+ mplayer-1.0_rc2_p20090530.ebuild, mplayer-9999.ebuild:
+ Fix osdmenu configuration, bug 274438
+
+ 08 Jun 2009; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc2_p20090322.ebuild:
+ Stable for HPPA (bug #272646).
+
+ 07 Jun 2009; Tobias Klausmann <klausman@gentoo.org>
+ mplayer-1.0_rc2_p20090322.ebuild:
+ Stable on alpha, bug #272646
+
+ 07 Jun 2009; Markus Meier <maekke@gentoo.org>
+ mplayer-1.0_rc2_p20090322.ebuild:
+ amd64/x86 stable, bug #272646
+
+ 06 Jun 2009; nixnut <nixnut@gentoo.org> mplayer-1.0_rc2_p20090322.ebuild:
+ ppc stable #272646
+
+ 04 Jun 2009; Steve Dibb <beandog@gentoo.org> metadata.xml:
+ Remove old realcodecs use flag
+
+ 04 Jun 2009; Steve Dibb <beandog@gentoo.org>
+ mplayer-1.0_rc2_p28450.ebuild, mplayer-1.0_rc2_p20090226.ebuild,
+ mplayer-1.0_rc2_p20090322.ebuild, mplayer-1.0_rc2_p20090530.ebuild,
+ mplayer-9999.ebuild:
+ Install input.conf and menu.conf in the correct location
+
+ 03 Jun 2009; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc2_p20090322.ebuild, mplayer-1.0_rc2_p20090530.ebuild,
+ -files/mplayer-1.0_rc2_p20090322-fix-mp3lib-use-local-labels.patch,
+ +files/mplayer-1.0_rc2_p20090530-fix-mp3lib-use-local-labels-2.patch:
+ Modify fix-mp3lib-use-local-labels to use jump 0b and 1b instead of 0 and
+ 1 wrt #271906, thanks to Luca Barbato. Remove the broken patch from old
+ version.
+
+ 02 Jun 2009; Steve Dibb <beandog@gentoo.org> mplayer-9999.ebuild:
+ Fix skin SRC_URI; Display live ebuild einfo only on live ebuild
+
+ 02 Jun 2009; Steve Dibb <beandog@gentoo.org>
+ mplayer-1.0_rc2_p28058-r1.ebuild, mplayer-1.0_rc2_p28288.ebuild,
+ mplayer-1.0_rc2_p28450.ebuild, mplayer-1.0_rc2_p20090226.ebuild,
+ mplayer-1.0_rc2_p20090322.ebuild, mplayer-1.0_rc2_p20090530.ebuild:
+ Update SRC_URI for Blue skin, bug 272249
+
+ 01 Jun 2009; Ben de Groot <yngwin@gentoo.org>
+ mplayer-1.0_rc2_p20090530.ebuild:
+ Fix versioning (bug 263720) and drop false message about being an
+ unsupported live ebuild
+
+ 31 May 2009; Samuli Suominen <ssuominen@gentoo.org>
+ mplayer-1.0_rc2_p20090530.ebuild:
+ Samuli is not an happy developer when broken patches are introduced. Fix
+ MP3 playing, again.
+
+ 31 May 2009; Diego E. Pettenò <flameeyes@gentoo.org>
+ mplayer-1.0_rc2_p20090530.ebuild:
+ Diego is not an happy developer when his patches are dropped. Fix build,
+ once again.
+
+ 30 May 2009; Tomáš Chvátal <scarabeus@gentoo.org> mplayer-9999.ebuild:
+ Update live ebuild. Reorder the DEPS to be alphabetic and more logicaly
+ separated. Update ebuild to work as snapshot version if properly renamed.
+ Minor whitespace updates. Use src_prepare function.
+
+*mplayer-1.0_rc2_p20090530 (30 May 2009)
+
+ 30 May 2009; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p20090530.ebuild:
+ Snapshot bump; Backport ebuild changes from live ebuild; drop arts
+
+ 30 May 2009; Steve Dibb <beandog@gentoo.org> mplayer-9999.ebuild,
+ metadata.xml:
+ Fix skin install, bug 271904; change gtk use flag to gmplayer
+
+ 29 May 2009; Steve Dibb <beandog@gentoo.org>
+ mplayer-1.0_rc2_p28450.ebuild, mplayer-9999.ebuild, metadata.xml:
+ Ebuild cleanup, see bug 267124. Change to EAPI2; fix faad deps; fix jack
+ deps; add libnut dep, use flag; fix rar dep; fix displaying svn version;
+ remove hppa hack; add osdmenu use flag; disable apple-ir on no lirc; add
+ shm use flag; unset more flags on custom-cflags use. Thanks to Andrew
+ Savchenko for lots of hard work.
+
+ 27 May 2009; Diego E. Pettenò <flameeyes@gentoo.org>
+ mplayer-1.0_rc2_p20090322.ebuild,
+ +files/mplayer-1.0_rc2_p20090322-fix-mp3lib-use-local-labels.patch,
+ +files/mplayer-1.0_rc2_p20090322-fix-undeclared-spudec.patch:
+ Add two patches: 1) fix spudec to be declared even without dvd support
+ enabled, patch from upstream; 2) fix mp3lib to use local labels and not
+ fail with -ftracer in CFLAGS, patch by Luca Barbato.
+
+ 24 Mar 2009; Ben de Groot <yngwin@gentoo.org> mplayer-1.0_rc2_p28058-r1,
+ mplayer-1.0_rc2_p28288, mplayer-1.0_rc2_p28450, mplayer-1.0_rc2_p20090226,
+ mplayer-1.0_rc2_p20090322, mplayer-9999:
+ Fix mangled unicode
+
+*mplayer-9999 (24 Mar 2009)
+
+ 24 Mar 2009; Steve Dibb <beandog@gentoo.org> +mplayer-9999.ebuild:
+ Add live ebuild
+
+ 24 Mar 2009; Steve Dibb <beandog@gentoo.org>
+ mplayer-1.0_rc2_p20090226.ebuild, mplayer-1.0_rc2_p20090322.ebuild:
+ Don't enable xvmc USE flag by default
+
+ 23 Mar 2009; Steve Dibb <beandog@gentoo.org>
+ mplayer-1.0_rc2_p20090226.ebuild, mplayer-1.0_rc2_p20090322.ebuild:
+ Don't enable vdpau, mad USE flags by default
+
+*mplayer-1.0_rc2_p20090322 (23 Mar 2009)
+
+ 23 Mar 2009; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p20090322.ebuild:
+ Snapshot bump; Remove strip-flags when using custom-cflags use flag, bug
+ 260064; Scale back default USE flags, bug 260588; Drop realplayer binary
+ support
+
+*mplayer-1.0_rc2_p20090226 (23 Mar 2009)
+
+ 23 Mar 2009; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p20090226.ebuild, -mplayer-20090226.28734.ebuild,
+ -mplayer-20090226.28734-r1.ebuild:
+ Migrate to new naming scheme
+
+*mplayer-20090226.28734-r1 (14 Mar 2009)
+
+ 14 Mar 2009; Ben de Groot <yngwin@gentoo.org>
+ +mplayer-20090226.28734-r1.ebuild:
+ Up the dependency on x264 to latest stable, so we can drop the patch. Some
+ cosmetic changes (slot deps). Fix MPLAYER_REVISION handling. Fix mangled
+ unicode for Polish spelling.
+
+ 28 Feb 2009; Markus Meier <maekke@gentoo.org> metadata.xml:
+ custom-cflags is a global USE-flag
+
+ 26 Feb 2009; Steve Dibb <beandog@gentoo.org>
+ mplayer-20090226.28734.ebuild:
+ Don't enable cpudetection for bindist
+
+ 26 Feb 2009; Steve Dibb <beandog@gentoo.org>
+ mplayer-20090226.28734.ebuild:
+ Fix vorbis dep
+
+ 26 Feb 2009; Steve Dibb <beandog@gentoo.org>
+ mplayer-20090226.28734.ebuild:
+ Add nvidia card to use flags
+
+*mplayer-20090226.28734 (26 Feb 2009)
+
+ 26 Feb 2009; Steve Dibb <beandog@gentoo.org> metadata.xml,
+ +mplayer-20090226.28734.ebuild:
+ Split real use flag into two: real for internal, realcodecs for binary;
+ Add faad, faac use flags for external AAC support; Add vdpau use flag; Add
+ more use flags to be enabled by default for that fresh just-works feeling;
+ Add tremor use flag for internal Vorbis support; Cleanup use flags, bug
+ 254661; Install more docs by default, bug 254671; Check for mng use flag,
+ bug 256054; Use unrar, add to mplayer.conf, bug 256203; Remove deprecated
+ DEPEND, bug 256146; New naming scheme DATE.SVN_REVISION; Add more
+ documentation to ebuild
+
+ 12 Feb 2009; Steve Dibb <beandog@gentoo.org>
+ mplayer-1.0_rc2_p28450.ebuild:
+ Enable more use flag options by default
+
+ 11 Feb 2009; Tobias Scherbaum <dertobi123@gentoo.org>
+ mplayer-1.0_rc2_p28450.ebuild:
+ ppc stable, bug #257381
+
+ 09 Feb 2009; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc2_p28450.ebuild:
+ ia64/sparc stable wrt #257381
+
+ 07 Feb 2009; Tobias Klausmann <klausman@gentoo.org>
+ mplayer-1.0_rc2_p28450.ebuild:
+ Stable on alpha, bug #257381
+
+ 05 Feb 2009; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc2_p28450.ebuild:
+ Stable for HPPA (bug #257381).
+
+ 04 Feb 2009; Markus Meier <maekke@gentoo.org>
+ mplayer-1.0_rc2_p28450.ebuild:
+ amd64/x86 stable, bug #257381
+
+ 04 Feb 2009; Brent Baude <ranger@gentoo.org>
+ mplayer-1.0_rc2_p28450.ebuild:
+ Marking mplayer-1.0_rc2_p28450 ppc64 for bug 257381
+
+*mplayer-1.0_rc2_p28450 (03 Feb 2009)
+
+ 03 Feb 2009; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p28450.ebuild:
+ Snapshot bump, security bug 257381
+
+*mplayer-1.0_rc2_p28288 (10 Jan 2009)
+
+ 10 Jan 2009; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p28288.ebuild:
+ Snapshot bump
+
+ For previous entries, please see ChangeLog-2008.
diff --git a/media-sound/mplayer/ChangeLog-2008 b/media-sound/mplayer/ChangeLog-2008
new file mode 100644
index 0000000..0412dbd
--- /dev/null
+++ b/media-sound/mplayer/ChangeLog-2008
@@ -0,0 +1,2904 @@
+# ChangeLog for media-video/mplayer
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/ChangeLog-2008,v 1.1 2012/01/02 15:53:34 dilfridge Exp $
+
+ 22 Dec 2008; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc2_p28058-r1.ebuild:
+ ia64/sparc stable wrt #251017
+
+ 20 Dec 2008; Tobias Klausmann <klausman@gentoo.org>
+ mplayer-1.0_rc2_p28058-r1.ebuild:
+ Stable on alpha, bug #251017
+
+ 18 Dec 2008; Tobias Scherbaum <dertobi123@gentoo.org>
+ mplayer-1.0_rc2_p28058-r1.ebuild:
+ ppc stable, bug #251017
+
+ 18 Dec 2008; Brent Baude <ranger@gentoo.org>
+ mplayer-1.0_rc2_p28058-r1.ebuild:
+ Marking mplayer-1.0_rc2_p28058-r1 ppc64 for bug 251017
+
+ 18 Dec 2008; Joshua Kinard <kumba@gentoo.org>
+ mplayer-1.0_rc2_p28058-r1.ebuild:
+ Added ~mips to KEYWORDS, per #205570.
+
+ 17 Dec 2008; Markus Meier <maekke@gentoo.org>
+ mplayer-1.0_rc2_p28058-r1.ebuild:
+ amd64/x86 stable, bug #251017
+
+ 17 Dec 2008; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc2_p28058-r1.ebuild:
+ Stable for HPPA (bug #251017).
+
+*mplayer-1.0_rc2_p28058-r1 (17 Dec 2008)
+
+ 17 Dec 2008; Steve Dibb <beandog@gentoo.org>
+ +files/mplayer-1.0_rc2_p28058-demux_vqf.patch,
+ +mplayer-1.0_rc2_p28058-r1.ebuild:
+ Add patch for security bug 251017; Change realplayer dep to realcodecs,
+ bug 249572
+
+ 13 Dec 2008; Friedrich Oslage <bluebird@gentoo.org>
+ +files/mplayer-libmpeg2.patch, +files/mplayer-libavcodec.patch,
+ -files/mplayer-libmpeg2-libavcodec.patch,
+ mplayer-1.0_rc2_p27725-r1.ebuild, mplayer-1.0_rc2_p28058.ebuild:
+ Split sparc compile patch into two files as the old mplayer needs both,
+ the new one only the one for libavcodec
+
+*mplayer-1.0_rc2_p28058 (02 Dec 2008)
+
+ 02 Dec 2008; Steve Dibb <beandog@gentoo.org> metadata.xml,
+ +mplayer-1.0_rc2_p28058.ebuild:
+ Snapshot bump; add libdvdnav, mng support; drop unnecessary docbook deps,
+ bug 174521; move srt use flag to ass, bug 241686
+
+ 24 Nov 2008; Friedrich Oslage <bluebird@gentoo.org>
+ mplayer-1.0_rc2_p27725-r1.ebuild:
+ Stable on sparc, security bug #239130 and bug #241110
+
+ 24 Nov 2008; Steve Dibb <beandog@gentoo.org>
+ +files/mplayer-libmpeg2-libavcodec.patch,
+ mplayer-1.0_rc2_p27725-r1.ebuild:
+ Fix sparc compilation, bug 241110; Thanks to Friedrich Oslage for patch
+
+ 10 Nov 2008; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc2_p27725-r1.ebuild:
+ ia64 stable wrt #239130
+
+ 08 Nov 2008; Tobias Klausmann <klausman@gentoo.org>
+ mplayer-1.0_rc2_p27725-r1.ebuild:
+ Stable on alpha, bug #239130
+
+ 30 Oct 2008; Tobias Scherbaum <dertobi123@gentoo.org>
+ mplayer-1.0_rc2_p27725-r1.ebuild:
+ ppc stable, bug #239130
+
+ 21 Oct 2008; Markus Rothe <corsair@gentoo.org>
+ mplayer-1.0_rc2_p27725-r1.ebuild:
+ Stable on ppc64; bug #239130
+
+ 20 Oct 2008; Guy Martin <gmsoft@gentoo.org>
+ mplayer-1.0_rc2_p27725-r1.ebuild:
+ hppa stable, #239130
+
+ 19 Oct 2008; Markus Meier <maekke@gentoo.org>
+ mplayer-1.0_rc2_p27725-r1.ebuild:
+ amd64/x86 stable, bug #239130
+
+ 15 Oct 2008; Alexis Ballier <aballier@gentoo.org>
+ mplayer-1.0_rc2_p27725-r1.ebuild:
+ keyword ~x86-fbsd
+
+*mplayer-1.0_rc2_p27725-r1 (07 Oct 2008)
+
+ 07 Oct 2008; Steve Dibb <beandog@gentoo.org>
+ +files/mplayer-1.0_rc2_p27725-libx264.patch,
+ -mplayer-1.0_rc2_p27725.ebuild, +mplayer-1.0_rc2_p27725-r1.ebuild:
+ Patch to build with x264, thanks to Alex Rostovtsev, bug 240347
+
+*mplayer-1.0_rc2_p27725 (07 Oct 2008)
+
+ 07 Oct 2008; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p27725.ebuild:
+ Version bump, security bugs 239130 and 231836
+
+ 16 Sep 2008; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc2_p27458.ebuild:
+ Marked ~hppa (bug #234629).
+
+ 24 Aug 2008; Markus Rothe <corsair@gentoo.org>
+ mplayer-1.0_rc2_p27458.ebuild:
+ Added ~ppc64; bug #234629
+
+ 20 Aug 2008; Steve Dibb <beandog@gentoo.org>
+ mplayer-1.0_rc2_p27458.ebuild:
+ Install midentify.sh to midentify
+
+ 17 Aug 2008; Alexis Ballier <aballier@gentoo.org> metadata.xml,
+ mplayer-1.0_rc2_p27458.ebuild:
+ Add dirac and schroedinger useflags that were automagic, thanks to Hanno
+ Boeck <hanno@gentoo.org> for reporting in bug #234775.
+
+ 17 Aug 2008; Alexis Ballier <aballier@gentoo.org>
+ mplayer-1.0_rc2_p27458.ebuild:
+ dont prestrip binaries
+
+ 17 Aug 2008; Alexis Ballier <aballier@gentoo.org>
+ mplayer-1.0_rc2_p27458.ebuild:
+ fix midentify install (was renamed to .sh) and add a die so that it'll be
+ spotted easily later
+
+*mplayer-1.0_rc2_p27120-r1 (13 Aug 2008)
+
+ 13 Aug 2008; Steve Dibb <beandog@gentoo.org>
+ -mplayer-1.0_rc2_p27120.ebuild, +mplayer-1.0_rc2_p27120-r1.ebuild:
+ Update x264 deps, bug 234287
+
+*mplayer-1.0_rc2_p27458 (13 Aug 2008)
+
+ 13 Aug 2008; Steve Dibb <beandog@gentoo.org> metadata.xml,
+ +mplayer-1.0_rc2_p27458.ebuild:
+ Snapshot bump; Re-enable pvr support, bug 230820; Fix dxr3 deps, bug
+ 233542; Fix x264 deps, bug 234287
+
+*mplayer-1.0_rc2_p27120 (21 Jun 2008)
+
+ 21 Jun 2008; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p27120.ebuild:
+ Snapshot bump; Add new notices about LINGUAS, gmplayer and cpudetection
+
+ 04 Jun 2008; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc2_p26753-r1.ebuild:
+ Stable for HPPA too.
+
+*mplayer-1.0_rc2_p26914 (28 May 2008)
+
+ 28 May 2008; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p26914.ebuild:
+ Snapshot bump
+
+*mplayer-1.0_rc2_p26753-r2 (26 May 2008)
+
+ 26 May 2008; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p26753-r2.ebuild:
+ Add custom-cpuopts use flag; add dxr2, dxr3 use flag, bug 223587
+
+ 22 May 2008; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc2_p26753-r1.ebuild:
+ ia64/x86 stable
+
+ 21 May 2008; Markus Rothe <corsair@gentoo.org>
+ mplayer-1.0_rc2_p26753-r1.ebuild:
+ Stable on ppc; bug #215006
+
+ 21 May 2008; Ferris McCormick <fmccor@gentoo.org>
+ mplayer-1.0_rc2_p26753-r1.ebuild:
+ Sparc stable, Security Bug #215006. All works well.
+
+ 21 May 2008; Markus Rothe <corsair@gentoo.org>
+ mplayer-1.0_rc2_p26753-r1.ebuild:
+ Stable on ppc64; bug #215006
+
+*mplayer-1.0_rc2_p26753-r1 (21 May 2008)
+
+ 21 May 2008; Steve Dibb <beandog@gentoo.org>
+ +files/configure-altivec.patch, +files/libswscale-sparc.patch,
+ +mplayer-1.0_rc2_p26753-r1.ebuild:
+ Fix compilation on ppc, sparc, bugs 217773, 222447 and 215006
+
+ Fix installing mplayer.desktop and mplayer.xpm, bug 219133
+
+ Remove strip restriction, bug 164492
+
+ Move CPU optimization checks out of custom-cflags use flag check, bug
+ 212318
+
+ 17 May 2008; Tobias Klausmann <klausman@gentoo.org>
+ mplayer-1.0_rc2_p26753.ebuild:
+ Stable on alpha, bug #215006
+
+ 17 May 2008; Markus Meier <maekke@gentoo.org>
+ mplayer-1.0_rc2_p26753.ebuild:
+ amd64/x86 stable, bug #215006
+
+ 16 May 2008; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc2_p26753.ebuild:
+ Stable for HPPA (bug #215006).
+
+*mplayer-1.0_rc2_p26753 (13 May 2008)
+
+ 13 May 2008; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p26753.ebuild:
+ Snapshot bump, security bug 215006; Display SVN version #, bug 218150;
+ Drop tivo use flag (no vstream client in tree); Fix v4l2, faac, faad,
+ xvid, x264, mp3lame disable flags
+
+*mplayer-1.0_rc2_p26454-r2 (17 Apr 2008)
+
+ 17 Apr 2008; Steve Dibb <beandog@gentoo.org>
+ +files/configure-unsetauto-v2.patch, -mplayer-1.0_rc2_p26454-r1.ebuild,
+ +mplayer-1.0_rc2_p26454-r2.ebuild:
+ Add patch to build on non-x86 arches
+
+*mplayer-1.0_rc2_p26454-r1 (16 Apr 2008)
+
+ 16 Apr 2008; Steve Dibb <beandog@gentoo.org>
+ +files/mplayer-1.0_rc2_p26454-makefile.patch,
+ -mplayer-1.0_rc2_p26454.ebuild, +mplayer-1.0_rc2_p26454-r1.ebuild:
+ Fix installing man pages, bug 217769, thanks to Daniel Pielmeier for patch
+
+*mplayer-1.0_rc2_p26454 (16 Apr 2008)
+
+ 16 Apr 2008; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p26454.ebuild:
+ Snapshot bump
+
+*mplayer-1.0_rc2_p24929-r4 (15 Apr 2008)
+
+ 15 Apr 2008; Steve Dibb <beandog@gentoo.org>
+ +files/mplayer-1.0_rc2_p24929-pulse.patch,
+ +mplayer-1.0_rc2_p24929-r4.ebuild:
+ Restore an old snapshot to provide some now lost functionality
+
+*mplayer-1.0_rc2_p26450 (15 Apr 2008)
+
+ 15 Apr 2008; Ben de Groot <yngwin@gentoo.org>
+ +mplayer-1.0_rc2_p26450.ebuild:
+ Snapshot bump. Removed color-console useflag, as it's no longer an
+ available option. Removed libdvdnav block on beandog's advice.
+
+ 07 Apr 2008; Ben de Groot <yngwin@gentoo.org>
+ mplayer-1.0_rc2_p25993.ebuild, mplayer-1.0_rc2_p26258.ebuild,
+ mplayer-1.0_rc2_p26300-r1.ebuild:
+ Pkgmove x264-svn to x264
+
+ 30 Mar 2008; Matthias Schwarzott <zzam@gentoo.org>
+ mplayer-1.0_rc2_p26300-r1.ebuild:
+ Fix the hack for USE="-quicktime win32codecs", Bug #213836.
+
+*mplayer-1.0_rc2_p26300-r1 (30 Mar 2008)
+
+ 30 Mar 2008; Steve Dibb <beandog@gentoo.org>
+ -mplayer-1.0_rc2_p26300.ebuild, +mplayer-1.0_rc2_p26300-r1.ebuild:
+ Build breaks on newer libdvdnav, add blocker to depend
+
+*mplayer-1.0_rc2_p26300 (29 Mar 2008)
+
+ 29 Mar 2008; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p26300.ebuild:
+ Snapshot bump, security bug 215006, compile with x86 and quicktime, bug
+ 213836
+
+*mplayer-1.0_rc2_p26258 (17 Mar 2008)
+
+ 17 Mar 2008; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p26258.ebuild:
+ Snapshot bump, add dga X11 dep, bug 213390, fix ssa subtitle memory leak,
+ bug 213638, move cpu optimization flags inside custom-cflags check
+
+*mplayer-1.0_rc2_p25993-r1 (23 Feb 2008)
+
+ 23 Feb 2008; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p25993-r1.ebuild:
+ Drop livecd use flag, bug 210066
+ Re-enable support for debug use flag
+ Add color-console use flag
+
+ 19 Feb 2008; Tobias Scherbaum <dertobi123@gentoo.org>
+ mplayer-1.0_rc2_p25993.ebuild:
+ ppc stable, bug #208566
+
+ 17 Feb 2008; Samuli Suominen <drac@gentoo.org>
+ mplayer-1.0_rc2_p25993.ebuild:
+ Fix unicode characters inside ebuild, someone edited it with notepad.exe or
+ such.
+
+ 17 Feb 2008; Samuli Suominen <drac@gentoo.org>
+ mplayer-1.0_rc2_p25993.ebuild:
+ Fixed automagic libXss depend, revealed by asneeded and depclean.
+
+ 17 Feb 2008; Christoph Mende <angelos@gentoo.org>
+ mplayer-1.0_rc2_p25993.ebuild:
+ Stable on amd64, security bug #208566
+
+ 15 Feb 2008; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc2_p25993.ebuild:
+ alpha/ia64 stable wrt security #208566
+
+ 15 Feb 2008; Samuli Suominen <drac@gentoo.org> -files/mplayer-dpms.patch,
+ -files/mplayer-xshape.patch, -mplayer-1.0_rc1_p20070824.ebuild,
+ mplayer-1.0_rc2_p24929-r1.ebuild, mplayer-1.0_rc2_p24929-r2.ebuild,
+ -mplayer-1.0_rc2_p24929-r3.ebuild, mplayer-1.0_rc2_p25993.ebuild:
+ Remove libdts references, unused ebuilds and patches.
+
+ 15 Feb 2008; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc2_p25993.ebuild:
+ Stable for HPPA (bug #208566).
+
+ 15 Feb 2008; Brent Baude <ranger@gentoo.org>
+ mplayer-1.0_rc2_p25993.ebuild:
+ Marking mplayer-1.0_rc2_p25993 ppc64 for bug 208566
+
+ 14 Feb 2008; Ferris McCormick <fmccor@gentoo.org>
+ mplayer-1.0_rc2_p25993.ebuild:
+ Sparc stable --- security Bug #208566.
+
+ 14 Feb 2008; Christian Faulhammer <opfer@gentoo.org>
+ mplayer-1.0_rc2_p25993.ebuild:
+ stable x86, security bug 208566
+
+*mplayer-1.0_rc2_p25993 (14 Feb 2008)
+
+ 14 Feb 2008; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p25993.ebuild:
+ Version snapshot bump, bug 208566
+
+ 26 Jan 2008; Alexis Ballier <aballier@gentoo.org>
+ mplayer-1.0_rc2_p24929-r3.ebuild:
+ Do the cflags mess on fbsd too, x86 doesnt have more registers there...
+
+*mplayer-1.0_rc2_p24929-r3 (24 Jan 2008)
+
+ 24 Jan 2008; Samuli Suominen <drac@gentoo.org>
+ +mplayer-1.0_rc2_p24929-r3.ebuild:
+ Revision bump for new dep., media-libs/libggiwmh used by USE ggi. Unkeyword
+ mips and ppc wrt #205570.
+
+ 17 Jan 2008; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc2_p24929-r1.ebuild:
+ alpha/ia64/sparc stable wrt #201859
+
+ 13 Jan 2008; nixnut <nixnut@gentoo.org> mplayer-1.0_rc2_p24929-r1.ebuild:
+ Stable on ppc wrt bug 201859
+
+ 10 Jan 2008; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc2_p24929-r1.ebuild:
+ Stable for HPPA (bug #201859).
+
+ 07 Jan 2008; Samuli Suominen <drac@gentoo.org>
+ -mplayer-1.0_rc1_p20070622-r1.ebuild,
+ -mplayer-1.0_rc1_p20070622-r4.ebuild:
+ Remove unused versions still depending only libdts because it's getting
+ removed in favour of libdca.
+
+ 05 Jan 2008; Brent Baude <ranger@gentoo.org>
+ mplayer-1.0_rc2_p24929-r1.ebuild:
+ Marking mplayer-1.0_rc2_p24929-r1 ppc64 for bug 201859
+
+ 05 Jan 2008; Markus Meier <maekke@gentoo.org>
+ mplayer-1.0_rc2_p24929-r1.ebuild:
+ x86 stable, bug #201859
+
+ 05 Jan 2008; Samuli Suominen <drac@gentoo.org>
+ mplayer-1.0_rc2_p24929-r1.ebuild:
+ amd64 stable wrt #201859
+
+*mplayer-1.0_rc2_p24929-r2 (05 Jan 2008)
+
+ 05 Jan 2008; Steve Dibb <beandog@gentoo.org>
+ +files/mplayer-1.0_rc2_p24929-pulse.patch,
+ +mplayer-1.0_rc2_p24929-r2.ebuild:
+ pulseaudio patch, bug 203430
+
+*mplayer-1.0_rc2_p24929-r1 (03 Jan 2008)
+
+ 03 Jan 2008; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p24929-r1.ebuild:
+ Fix x264 encode dep, bug 203594
+ Drop support for IVTV, PVR
+
+ 28 Dec 2007; Raúl Porcel <armin76@gentoo.org> mplayer-1.0_rc2.ebuild:
+ alpha/ia64/x86 stable
+
+ 05 Dec 2007; Dawid Węgliński <cla@gentoo.org> mplayer-1.0_rc2.ebuild,
+ mplayer-1.0_rc1_p20070824.ebuild, mplayer-1.0_rc1_p20070927-r1.ebuild,
+ mplayer-1.0_rc2_p24929.ebuild:
+ Fix polish locales plus some quotes
+
+ 01 Dec 2007; Markus Rothe <corsair@gentoo.org> mplayer-1.0_rc2.ebuild:
+ Stable on ppc64
+
+ 02 Nov 2007; Raúl Porcel <armin76@gentoo.org> mplayer-1.0_rc2.ebuild:
+ sparc stable wrt #192601, thanks to Alex Maclean for testing
+
+*mplayer-1.0_rc2_p24929 (02 Nov 2007)
+
+ 02 Nov 2007; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_p24929.ebuild:
+ Version bump
+ Rename patch versioning scheme to SVN release
+ Add pulseaudio use flag
+ Add ladspa use flag, bug 197753
+ Remove lame use flag, use lame as mp3 encoding
+
+*mplayer-1.0_rc2 (10 Oct 2007)
+
+ 10 Oct 2007; Steve Dibb <beandog@gentoo.org> +mplayer-1.0_rc2.ebuild:
+ Version bump, bug 195154
+
+ 08 Oct 2007; Markus Rothe <corsair@gentoo.org>
+ mplayer-1.0_rc1_p20070824.ebuild:
+ Stable on ppc64; bug #192601
+
+*mplayer-1.0_rc1_p20070927-r1 (28 Sep 2007)
+
+ 28 Sep 2007; Steve Dibb <beandog@gentoo.org>
+ -mplayer-1.0_rc1_p20070927.ebuild, +mplayer-1.0_rc1_p20070927-r1.ebuild:
+ Fix a52 typo, bug 194079
+
+*mplayer-1.0_rc1_p20070927 (27 Sep 2007)
+
+ 27 Sep 2007; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc1_p20070927.ebuild:
+ Subversion bump, install a52 by default with dvd use flag, switch xvmc
+ linking back to generic lib
+
+ 24 Sep 2007; Samuli Suominen <drac@gentoo.org>
+ mplayer-1.0_rc1_p20070824.ebuild:
+ Trivial fix for video_cards mga installation wrt #192752.
+
+ 24 Sep 2007; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc1_p20070824.ebuild:
+ alpha/ia64 stable wrt #192601
+
+ 16 Sep 2007; Lars Weiler <pylon@gentoo.org>
+ mplayer-1.0_rc1_p20070824.ebuild:
+ Stable on ppc; bug #192601.
+
+ 16 Sep 2007; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc1_p20070824.ebuild:
+ Stable for HPPA (bug #192601).
+
+ 16 Sep 2007; Jurek Bartuszek <jurek@gentoo.org>
+ mplayer-1.0_rc1_p20070824.ebuild:
+ x86 stable (bug #192601)
+
+ 15 Sep 2007; Christoph Mende <angelos@gentoo.org>
+ mplayer-1.0_rc1_p20070824.ebuild:
+ Stable on amd64 wrt bug #192601
+
+ 08 Sep 2007; Joseph Jezak <josejx@gentoo.org>
+ mplayer-1.0_rc1_p20070622-r4.ebuild:
+ Marked ppc/ppc64 stable for bug #190531.
+
+ 07 Sep 2007; Stuart Longland <redhatter@gentoo.org>
+ mplayer-1.0_rc1_p20070824.ebuild:
+ Tested and working on MIPS. Keyworded ~mips
+
+ 02 Sep 2007; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0_rc1_p20070622-r4.ebuild:
+ alpha/ia64 stable wrt #190531
+
+ 30 Aug 2007; Jeroen Roovers <jer@gentoo.org>
+ mplayer-1.0_rc1_p20070622-r4.ebuild:
+ Stable for HPPA (bug #190531).
+
+ 28 Aug 2007; Jurek Bartuszek <jurek@gentoo.org>
+ mplayer-1.0_rc1_p20070622-r4.ebuild:
+ x86 stable (bug #190531)
+
+ 28 Aug 2007; Steve Dibb <beandog@gentoo.org> -files/mplayer.desktop:
+ Remove unused mplayer.desktop
+
+*mplayer-1.0_rc1_p20070824 (28 Aug 2007)
+*mplayer-1.0_rc1_p20070622-r4 (28 Aug 2007)
+*mplayer-1.0_rc1_p20070622-r1 (28 Aug 2007)
+
+ 28 Aug 2007; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc1_p20070622-r1.ebuild,
+ +mplayer-1.0_rc1_p20070622-r4.ebuild, +mplayer-1.0_rc1_p20070824.ebuild:
+ Fix versioning scheme of ebuilds, bug 175688
+
+ 28 Aug 2007; Steve Dibb <beandog@gentoo.org>
+ -files/mplayer-1.0_rc1-asmrules.patch,
+ -files/mplayer-undefined-reference-fix.patch, -mplayer-1.0_rc1-r2.ebuild,
+ -mplayer-1.0.20070321.ebuild, -mplayer-1.0.20070321-r1.ebuild,
+ -mplayer-1.0.20070427.ebuild, -mplayer-1.0.20070622-r3.ebuild,
+ -mplayer-1.0.20070814.ebuild:
+ Remove old (some with security bugs) versions of mplayer w/patches, in
+ anticipation of naming scheme reboot
+
+ 28 Aug 2007; Steve Dibb <beandog@gentoo.org>
+ mplayer-1.0.20070622-r4.ebuild:
+ amd64 stable, bug 190531
+
+*mplayer-1.0.20070622-r4 (28 Aug 2007)
+
+ 28 Aug 2007; Steve Dibb <beandog@gentoo.org>
+ +files/mplayer-libdvdcss.patch, +mplayer-1.0.20070622-r4.ebuild:
+ Backport libdvdcss patch from upstream, bug 189665
+
+*mplayer-1.0.20070824 (25 Aug 2007)
+
+ 25 Aug 2007; Steve Dibb <beandog@gentoo.org> +mplayer-1.0.20070824.ebuild:
+ SVN snapshot version bump
+
+ 16 Aug 2007; Steve Dibb <beandog@gentoo.org> mplayer-1.0.20070814.ebuild:
+ Fix ivtv linux-headers dep, re-add PVR use flag
+
+ 15 Aug 2007; Samuli Suominen <drac@gentoo.org>
+ mplayer-1.0.20070814.ebuild:
+ Flip libdts and libdca deps around, so libdca gets installed over libdts
+ primarily.
+
+*mplayer-1.0.20070814 (14 Aug 2007)
+
+ 14 Aug 2007; Steve Dibb <beandog@gentoo.org> +mplayer-1.0.20070814.ebuild:
+ SVN snapshot version bump
+ Fix xinerama scaling, bug 187382
+ Enable libcdio support, bug 184783
+ Fix broken symlink for mplayer.conf, bug 183099
+ Remove app-arch/unzip from DEPEND
+ Add video card + xvmc support for nvidia, i810, bug 184186
+ Remove dvdnav support
+ Restore original a52 use flag check, add ewarn if using dvd use flag
+ Add teletext use flag
+ Fix DTS dependencies, bug 186854
+
+ 12 Aug 2007; Samuli Suominen <drac@gentoo.org> +files/mplayer-dpms.patch,
+ mplayer-1.0.20070622-r3.ebuild:
+ Fix DPMS detection at configure time with -Wl,--as-needed.
+
+*mplayer-1.0.20070622-r3 (28 Jul 2007)
+
+ 28 Jul 2007; Steve Dibb <beandog@gentoo.org>
+ mplayer-1.0.20070622-r2.ebuild, +mplayer-1.0.20070622-r3.ebuild:
+ Remove pulseaudio patch, being developed upstream, add warning on old version
+
+*mplayer-1.0.20070622-r2 (26 Jul 2007)
+
+ 26 Jul 2007; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0.20070622-r2.ebuild:
+ Remove debug option, since it is broken in this release, add pulseaudio
+ support, bug 183230 (thanks to drizzt for patch)
+
+ 05 Jul 2007; Markus Rothe <corsair@gentoo.org>
+ mplayer-1.0.20070622-r1.ebuild:
+ Stable on ppc64; bug #181097
+
+ 05 Jul 2007; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0.20070622-r1.ebuild:
+ alpha/ia64 stable
+
+ 04 Jul 2007; Gustavo Zacarias <gustavoz@gentoo.org>
+ mplayer-1.0.20070622-r1.ebuild:
+ Stable on sparc
+
+ 04 Jul 2007; René Nussbaumer <killerfox@gentoo.org>
+ mplayer-1.0.20070622-r1.ebuild:
+ Stable on hppa. See bug #181097.
+
+ 02 Jul 2007; Piotr Jaroszyński <peper@gentoo.org>
+ mplayer-1.0_rc1-r2.ebuild, mplayer-1.0.20070321.ebuild,
+ mplayer-1.0.20070321-r1.ebuild, mplayer-1.0.20070427.ebuild,
+ mplayer-1.0.20070622.ebuild, mplayer-1.0.20070622-r1.ebuild:
+ (QA) RESTRICT clean up.
+
+ 28 Jun 2007; Tobias Scherbaum <dertobi123@gentoo.org>
+ mplayer-1.0.20070622-r1.ebuild:
+ ppc stable, bug #181097
+
+ 25 Jun 2007; Gustavo Zacarias <gustavoz@gentoo.org>
+ mplayer-1.0.20070622.ebuild:
+ Stable on sparc wrt security #181097
+
+ 25 Jun 2007; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0.20070622-r1.ebuild:
+ x86 stable wrt security #181097
+
+ 25 Jun 2007; Steve Dibb <beandog@gentoo.org>
+ mplayer-1.0.20070622-r1.ebuild:
+ Add support for SSSE3
+
+*mplayer-1.0.20070622-r1 (24 Jun 2007)
+
+ 24 Jun 2007; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0.20070622-r1.ebuild:
+ Cleanup dvd use flags, bug 174721; don't disable a52 internal support unless
+ -dvd is used, bug 181082
+
+ 24 Jun 2007; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0.20070622.ebuild:
+ alpha/ia64 stable wrt security #181097
+
+ 24 Jun 2007; Samuli Suominen <drac@gentoo.org>
+ mplayer-1.0.20070622.ebuild:
+ Makefile allready installs both pixmap and desktop file so stop doing that
+ inside ebuild.
+
+ 23 Jun 2007; Christoph Mende <angelos@gentoo.org>
+ mplayer-1.0.20070622.ebuild:
+ Stable on amd64 wrt security bug 181097
+
+ 23 Jun 2007; Jeroen Roovers <jer@gentoo.org> mplayer-1.0.20070622.ebuild:
+ Stable for HPPA (bug #181097).
+
+ 23 Jun 2007; Markus Rothe <corsair@gentoo.org>
+ mplayer-1.0.20070622.ebuild:
+ Stable on ppc64; bug #181097
+
+ 22 Jun 2007; Steve Dibb <beandog@gentoo.org> mplayer-1.0.20070622.ebuild:
+ Fix dts configuration, bug 182914
+
+*mplayer-1.0.20070622 (22 Jun 2007)
+
+ 22 Jun 2007; Steve Dibb <beandog@gentoo.org> +mplayer-1.0.20070622.ebuild:
+ Version bump, security bug 181097
+
+ 10 Jun 2007; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20070427.ebuild:
+ Altivec works on ppc...
+
+ 20 May 2007; Steve Dibb <beandog@gentoo.org> mplayer-1.0.20070321.ebuild,
+ mplayer-1.0.20070427.ebuild:
+ Fix install location of desktop xpm, bug 179257
+
+ 03 May 2007; Tobias Scherbaum <dertobi123@gentoo.org>
+ mplayer-1.0.20070321.ebuild:
+ ppc stable, bug #168917
+
+ 02 May 2007; Jeroen Roovers <jer@gentoo.org> mplayer-1.0.20070321.ebuild:
+ Stable for HPPA (bug #168917).
+
+ 02 May 2007; Bryan Østergaard <kloeri@gentoo.org>
+ mplayer-1.0.20070321.ebuild:
+ Stable on Alpha, bug 168917.
+
+*mplayer-1.0.20070321-r1 (01 May 2007)
+
+ 01 May 2007; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0.20070321-r1.ebuild:
+ Remove .svn directories, bug 172198
+
+ 01 May 2007; Markus Rothe <corsair@gentoo.org>
+ mplayer-1.0.20070321.ebuild:
+ Stable on ppc64; bug #168917
+
+ 30 Apr 2007; Gustavo Zacarias <gustavoz@gentoo.org>
+ mplayer-1.0.20070321.ebuild:
+ Stable on sparc wrt security #168917
+
+ 30 Apr 2007; Raúl Porcel <armin76@gentoo.org>
+ mplayer-1.0.20070321.ebuild:
+ ia64 + x86 stable wrt security bug 168917
+
+*mplayer-1.0.20070427 (27 Apr 2007)
+
+ 27 Apr 2007; Steve Dibb <beandog@gentoo.org> +mplayer-1.0.20070427.ebuild:
+ Version bump, fix bug 172198
+
+ 26 Apr 2007; Steve Dibb <beandog@gentoo.org> mplayer-1.0.20070321.ebuild:
+ amd64 stable
+
+ 26 Apr 2007; Steve Dibb <beandog@gentoo.org> -mplayer-1.0_rc1.ebuild,
+ -mplayer-1.0_rc1-r1.ebuild:
+ Removing old version with security issue, bug 159727
+
+ 26 Apr 2007; Steve Dibb <beandog@gentoo.org> -mplayer-1.0_pre8-r1.ebuild:
+ Removing old version with security issue, bug 159727
+
+*mplayer-1.0.20070321 (26 Apr 2007)
+
+ 26 Apr 2007; Steve Dibb <beandog@gentoo.org> +mplayer-1.0.20070321.ebuild,
+ -mplayer-1.0_rc2_pre20070321-r4.ebuild:
+ Fix naming scheme
+
+ 09 Apr 2007; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0_rc2_pre20070321-r4.ebuild:
+ missing places...
+
+ 09 Apr 2007; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0_rc2_pre20070321-r4.ebuild:
+ MPlayer now installs the default config in /etc/mplayer/mplayer.conf
+
+ 02 Apr 2007; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0_rc2_pre20070321-r4.ebuild:
+ Remove wrong deps
+
+ 28 Mar 2007; Steve Dibb <beandog@gentoo.org>
+ -mplayer-1.0_rc2_pre20070321-r3.ebuild,
+ mplayer-1.0_rc2_pre20070321-r4.ebuild:
+ - Fix tga use flag, bug 172372
+ - Make mp2 use flag dependent on encode, make dv and x264 use flags
+ independent, bug 172232
+
+ 25 Mar 2007; Steve Dibb <beandog@gentoo.org>
+ mplayer-1.0_rc2_pre20070321-r3.ebuild:
+ Fix tdfx use flag (bug 172170)
+
+*mplayer-1.0_rc2_pre20070321-r4 (25 Mar 2007)
+
+ 25 Mar 2007; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_pre20070321-r4.ebuild:
+ - Remove dependency on media-libs/a52dec
+ - Fix tdfx use flag (bug 172170)
+ - Remove LINGUAS use flags, rely on variable from make.conf to set languages,
+ add notice of special ordering
+ - Fix CPU optimization use flags ( bug 155232 )
+ - Remove -j1 from MAKEOPTS ( bug 86245 )
+
+*mplayer-1.0_rc2_pre20070321-r3 (23 Mar 2007)
+
+ 23 Mar 2007; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_pre20070321-r3.ebuild:
+ - Add vidix use flag
+ - Fix lzo use flag dependency
+ - Fix speex use flag dependency
+ - Fix srt+truetype+iconv cascading dependencies
+ - Re-add fontconfig and subfont options to mplayer.conf for truetype
+ - Force win32codecs dep on real use flag for x86
+ - Fix HPPA compilation, disable cpudetection on certain arches ( bug 171879 )
+ - Force OSS audio dep on radio use flag ( bug 171850 )
+ - Fix mp2 dependency ( toolame -> twolame )
+ - Cleanup RDEPEND tree
+ - Drop libdvdread dependency
+ - Add libdvdnav dependency
+ - Optional mp3 dependency on lame
+ - Dont disable vidix on -svga
+ - Cleanup DVB/V4L/Radio checks
+ - dodoc Changelog
+
+*mplayer-1.0_rc2_pre20070321-r2 (22 Mar 2007)
+
+ 22 Mar 2007; Steve Dibb <beandog@gentoo.org> +files/mplayer-xshape.patch,
+ +mplayer-1.0_rc2_pre20070321-r2.ebuild:
+ Add XShape detection patch, thanks to anarchy
+
+*mplayer-1.0_rc2_pre20070321-r1 (22 Mar 2007)
+
+ 22 Mar 2007; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_pre20070321-r1.ebuild:
+ Remove some configuration changes, remove changing font options on mplayer.conf
+
+*mplayer-1.0_rc2_pre20070321 (22 Mar 2007)
+
+ 22 Mar 2007; Steve Dibb <beandog@gentoo.org>
+ +mplayer-1.0_rc2_pre20070321.ebuild:
+ Version bump
+
+ 17 Feb 2007; Simon Stelling <blubb@gentoo.org> mplayer-1.0_rc1-r2.ebuild:
+ only use amd64codecs if we're not distributing the build
+
+ 16 Feb 2007; Simon Stelling <blubb@gentoo.org> mplayer-1.0_rc1-r2.ebuild:
+ depend on >=portage-2.1.2 to make sure the assembler USE flags are unmasked
+ on amd64
+
+ 13 Feb 2007; Markus Rothe <corsair@gentoo.org> mplayer-1.0_rc1-r2.ebuild:
+ Stable on ppc64; bug #159727
+
+ 12 Feb 2007; Bryan Østergaard <kloeri@gentoo.org>
+ mplayer-1.0_rc1-r2.ebuild:
+ Stable on Alpha, bug 159727.
+
+ 12 Feb 2007; Bryan Østergaard <kloeri@gentoo.org>
+ mplayer-1.0_rc1-r2.ebuild:
+ Stable on IA64, bug 159727.
+
+ 12 Feb 2007; Gustavo Zacarias <gustavoz@gentoo.org>
+ mplayer-1.0_rc1-r2.ebuild:
+ Stable on sparc wrt security #159727
+
+ 11 Feb 2007; Simon Stelling <blubb@gentoo.org> mplayer-1.0_rc1-r2.ebuild:
+ stable on amd64; security bug 159727
+
+ 11 Feb 2007; René Nussbaumer <killerfox@gentoo.org>
+ mplayer-1.0_rc1-r2.ebuild:
+ Stable on hppa. See bug #159727.
+
+ 11 Feb 2007; Tobias Scherbaum <dertobi123@gentoo.org>
+ mplayer-1.0_rc1-r2.ebuild:
+ Stable on ppc wrt bug #159727.
+
+ 11 Feb 2007; Christian Faulhammer <opfer@gentoo.org>
+ mplayer-1.0_rc1-r2.ebuild:
+ stable x86; security bug #159727
+
+ 01 Feb 2007; Steve Dibb <beandog@gentoo.org> mplayer-1.0_rc1.ebuild,
+ mplayer-1.0_rc1-r1.ebuild, mplayer-1.0_rc1-r2.ebuild:
+ Disable ivtv video output support, bug 164748
+
+*mplayer-1.0_rc1-r2 (30 Jan 2007)
+
+ 30 Jan 2007; Steve Dibb <beandog@gentoo.org>
+ +files/mplayer-1.0_rc1-asmrules.patch, +mplayer-1.0_rc1-r2.ebuild:
+ Add asmrules security patch from upstream, bug 159727
+
+ 30 Jan 2007; Steve Dibb <beandog@gentoo.org> mplayer-1.0_rc1.ebuild,
+ mplayer-1.0_rc1-r1.ebuild:
+ Upgrade main Blue skin to 1.7
+
+ 17 Jan 2007; Christian Faulhammer <opfer@gentoo.org>
+ mplayer-1.0_rc1.ebuild:
+ filter -fomit-frame-pointer when USE=debug is set
+
+ 09 Jan 2007; Olivier Crête <tester@gentoo.org> mplayer-1.0_rc1.ebuild:
+ Stable on amd64 for bugs #157814 and #161053
+
+*mplayer-1.0_rc1-r1 (06 Jan 2007)
+
+ 06 Jan 2007; Steve Dibb <beandog@gentoo.org> +mplayer-1.0_rc1-r1.ebuild:
+ Add amd64codecs support for real libs on amd64
+
+ 04 Jan 2007; Christian Faulhammer <opfer@gentoo.org>
+ mplayer-1.0_rc1.ebuild:
+ stable x86, bug #157814
+
+ 03 Jan 2007; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_rc1.ebuild:
+ disable dvdnav for now
+
+ 31 Dec 2006; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_rc1.ebuild:
+ fix mplayer to build against the latest live555.com
+
+ 23 Dec 2006; Tobias Scherbaum <dertobi123@gentoo.org>
+ mplayer-1.0_rc1.ebuild:
+ Stable on ppc wrt bug #157814.
+
+ 21 Dec 2006; Gustavo Zacarias <gustavoz@gentoo.org>
+ mplayer-1.0_pre8.ebuild, mplayer-1.0_pre8-r1.ebuild,
+ mplayer-1.0_rc1.ebuild:
+ Stable on sparc wrt #157814
+
+ 21 Dec 2006; Markus Rothe <corsair@gentoo.org> mplayer-1.0_rc1.ebuild:
+ Stable on ppc64; bug #157814
+
+ 10 Dec 2006; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_rc1.ebuild:
+ Fix faac dep
+
+ 11 Dec 2006; Diego Pettenò <flameeyes@gentoo.org> mplayer-1.0_rc1.ebuild:
+ Tell the configure script to sue the correct CC/BUILD_CC compiler, close bug
+ #155515, thanks to Timothy Redaelli for reporting.
+
+ 01 Dec 2006; Steve Dibb <beandog@gentoo.org> mplayer-1.0_rc1.ebuild:
+ Disable pvr support
+
+ 21 Nov 2006; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_rc1.ebuild:
+ fix the iconv-truetype logic, thanks to hansmi for pointing the issue
+
+ 14 Nov 2006; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_rc1.ebuild:
+ Typo, fixed thanks to baru reddy <barureddy@yahoo.com> and zzam, see
+ bug #154504
+
+ 07 Nov 2006; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_rc1.ebuild:
+ Improve default config
+
+ 06 Nov 2006; Steve Dibb <beandog@gentoo.org>
+ files/digest-mplayer-1.0_pre8, files/digest-mplayer-1.0_pre8-r1,
+ files/digest-mplayer-1.0_rc1, Manifest:
+ Fix Blue skin digest, again, bug #152694
+
+ 03 Nov 2006; Patrick McLean <chutzpah@gentoo.org> mplayer-1.0_rc1.ebuild:
+ Clean up custom-cflags a bit, add -fomit-frame-pointer as it seems to be
+ required to compile some of the inline asm.
+
+ 31 Oct 2006; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_rc1.ebuild:
+ Fix some packaging issue part II
+
+ 31 Oct 2006; Luca Barbato <lu_zero@gentoo.org>
+ -mplayer-1.0_pre20060810.ebuild, -mplayer-1.0_pre20061019.ebuild:
+ Cleanup
+
+ 31 Oct 2006; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre8.ebuild,
+ mplayer-1.0_pre8-r1.ebuild, mplayer-1.0_pre20060810.ebuild,
+ mplayer-1.0_pre20061019.ebuild, mplayer-1.0_rc1.ebuild:
+ Fix packaging, do not install codecs.conf anymore
+
+ 30 Oct 2006; Diego Pettenò <flameeyes@gentoo.org>
+ mplayer-1.0_pre8.ebuild, mplayer-1.0_pre8-r1.ebuild,
+ mplayer-1.0_pre20060810.ebuild, mplayer-1.0_pre20061019.ebuild,
+ mplayer-1.0_rc1.ebuild:
+ Add ~x86-fbsd keyword.
+
+ 27 Oct 2006; Steve Dibb <beandog@gentoo.org> mplayer-1.0_rc1.ebuild:
+ Add subtitles USE flag, notes about freetype, iconv
+
+ 26 Oct 2006; Vlastimil Babka <caster@gentoo.org> mplayer-1.0_rc1.ebuild:
+ Apply the previous patch in $S. Fixes bug #152842.
+
+ 25 Oct 2006; Steve Dibb <beandog@gentoo.org> mplayer-1.0_pre8.ebuild,
+ mplayer-1.0_pre8-r1.ebuild, mplayer-1.0_pre20060810.ebuild,
+ mplayer-1.0_pre20061019.ebuild, mplayer-1.0_rc1.ebuild:
+ Remove XMMS support
+
+ 25 Oct 2006; Luca Barbato <lu_zero@gentoo.org>
+ +files/mplayer-undefined-reference-fix.patch, mplayer-1.0_rc1.ebuild:
+ fix ppc64
+
+ 25 Oct 2006; Steve Dibb <beandog@gentoo.org>
+ files/digest-mplayer-1.0_pre8, files/digest-mplayer-1.0_pre8-r1,
+ files/digest-mplayer-1.0_pre20060810,
+ files/digest-mplayer-1.0_pre20061019, files/digest-mplayer-1.0_rc1,
+ Manifest:
+ Fix digest for blue skin, bug #152694
+
+ 25 Oct 2006; Simon Stelling <blubb@gentoo.org> mplayer-1.0_pre8.ebuild,
+ mplayer-1.0_pre8-r1.ebuild, mplayer-1.0_rc1.ebuild:
+ backport the asm fixes and don't hard-enable mmxext either
+
+ 25 Oct 2006; Luca Barbato <lu_zero@gentoo.org>
+ files/digest-mplayer-1.0_pre8, files/digest-mplayer-1.0_pre8-r1,
+ files/digest-mplayer-1.0_pre20060810,
+ files/digest-mplayer-1.0_pre20061019, files/digest-mplayer-1.0_rc1,
+ Manifest:
+ Redigest
+
+ 24 Oct 2006; Simon Stelling <blubb@gentoo.org> mplayer-1.0_rc1.ebuild:
+ don't hard-enable 3dnow(ext) on amd64 as EM64T doesn't have it
+
+*mplayer-1.0_rc1 (23 Oct 2006)
+
+ 23 Oct 2006; Luca Barbato <lu_zero@gentoo.org> +mplayer-1.0_rc1.ebuild:
+ New version
+
+ 20 Oct 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0_pre20061019.ebuild:
+ change the src_uri to something valid
+
+*mplayer-1.0_pre20061019 (19 Oct 2006)
+
+ 19 Oct 2006; Luca Barbato <lu_zero@gentoo.org>
+ +mplayer-1.0_pre20061019.ebuild:
+ New snapshot
+
+ 19 Oct 2006; Luca Barbato <lu_zero@gentoo.org>
+ files/digest-mplayer-1.0_pre8, files/digest-mplayer-1.0_pre8-r1,
+ files/digest-mplayer-1.0_pre20060810, Manifest:
+ Redigesting Blue-1.6 skin
+
+ 06 Oct 2006; Simon Stelling <blubb@gentoo.org>
+ +files/mplayer-1.0_pre8-amr-64bit.patch, mplayer-1.0_pre8-r1.ebuild:
+ fix AMR support on amd64; bug 140753; thanks to Maxxer for providing a patch
+
+ 22 Sep 2006; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre8.ebuild,
+ mplayer-1.0_pre8-r1.ebuild, mplayer-1.0_pre20060810.ebuild:
+ LINGUAS support updated, thanks to Damien THEBAULT
+ <damien.thebault@laposte.net> for providing the initial patch in bug #143782
+
+ 21 Sep 2006; Patrick McLean <chutzpah@gentoo.org> mplayer-1.0_pre8.ebuild,
+ mplayer-1.0_pre8-r1.ebuild, mplayer-1.0_pre20060810.ebuild:
+ Bump Blue skin to version 1.6.
+
+ 12 Aug 2006; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre8.ebuild,
+ mplayer-1.0_pre8-r1.ebuild:
+ Pin x264 version to avoid build issue with snapshots too new
+
+ 10 Aug 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0_pre20060810.ebuild:
+ Everything ready for wider usage
+
+ 10 Aug 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0_pre20060810.ebuild:
+ hickup during the snapshot, temp masked
+
+ 10 Aug 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0_pre20060810.ebuild:
+ don't try to specify dvb include path
+
+ 10 Aug 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0_pre20060810.ebuild:
+ x264 dep updated
+
+*mplayer-1.0_pre20060810 (10 Aug 2006)
+
+ 10 Aug 2006; Luca Barbato <lu_zero@gentoo.org>
+ +mplayer-1.0_pre20060810.ebuild:
+ Early snapshot
+
+ 10 Aug 2006; Luca Barbato <lu_zero@gentoo.org>
+ -files/mplayer-1.0_pre7-gcc4-amd64.patch,
+ -files/mplayer-1.0_pre7-gcc4.patch,
+ -files/mplayer-1.0_pre7-gcc_detection.patch,
+ -files/mplayer-1.0_pre7-ppc64.patch,
+ -files/gcc-3-register_allocation.patch, -files/mplayer-mythtv.patch,
+ -mplayer-1.0_pre7-r1.ebuild, -mplayer-1.0.20060102.ebuild,
+ -mplayer-1.0.20060217.ebuild, -mplayer-1.0.20060302.ebuild,
+ -mplayer-1.0.20060408.ebuild, -mplayer-1.0.20060415.ebuild:
+ Cleanup
+
+ 28 Jul 2006; Chris Bainbridge <chrb@gentoo.org> mplayer-1.0_pre8.ebuild,
+ mplayer-1.0_pre8-r1.ebuild:
+ Fix "line 338: !use: command not found"
+
+ 18 Jul 2006; Chris Gianelloni <wolf31o2@gentoo.org>
+ mplayer-1.0_pre8.ebuild, mplayer-1.0_pre8-r1.ebuild:
+ Made sure the win32codecs code is not used when USE has either livecd or
+ bindist in it. This allows us to redistribute mplayer for GRP, though it
+ does reduce its functionality.
+
+ 15 Jul 2006; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre8-r1.ebuild:
+ split unicode from iconv
+
+ 13 Jul 2006; Aron Griffis <agriffis@gentoo.org> mplayer-1.0_pre8.ebuild,
+ mplayer-1.0_pre8-r1.ebuild, mplayer-1.0.20060102.ebuild,
+ mplayer-1.0.20060217.ebuild, mplayer-1.0.20060302.ebuild,
+ mplayer-1.0.20060408.ebuild, mplayer-1.0.20060415.ebuild:
+ Mark 1.0_pre8 stable on ia64, mark 1.0_pre8-r1 ~ia64, arch-mask 1.0.20060415
+ 1.0.20060408 1.0.20060302 1.0.20060217 1.0.20060102 on ia64. #136520 #139955
+
+ 12 Jul 2006; Gustavo Zacarias <gustavoz@gentoo.org>
+ mplayer-1.0_pre8-r1.ebuild:
+ Keyworded ~sparc wrt #139955
+
+ 12 Jul 2006; Danny van Dyk <kugelfang@gentoo.org>
+ mplayer-1.0_pre8-r1.ebuild, mplayer-1.0.20060408.ebuild,
+ mplayer-1.0.20060415.ebuild:
+ QA: Added nls, enca to IUSE.
+
+ 11 Jul 2006; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre8-r1.ebuild:
+ Cleanup and modular X only now
+
+ 09 Jul 2006; Diego Pettenò <flameeyes@gentoo.org>
+ mplayer-1.0_pre7-r1.ebuild, mplayer-1.0_pre8.ebuild,
+ mplayer-1.0.20060102.ebuild, mplayer-1.0.20060217.ebuild,
+ mplayer-1.0.20060302.ebuild, mplayer-1.0.20060408.ebuild,
+ mplayer-1.0.20060415.ebuild:
+ Pinpoint virtual/x11 version to less than 7.
+
+*mplayer-1.0_pre8-r1 (11 Jul 2006)
+
+ 11 Jul 2006; Luca Barbato <lu_zero@gentoo.org>
+ +mplayer-1.0_pre8-r1.ebuild:
+ New ebuild, adds amr, enca and xvmc wrappers support
+
+ 03 Jul 2006; Thomas Cort <tcort@gentoo.org> mplayer-1.0.20060102.ebuild,
+ mplayer-1.0.20060217.ebuild, mplayer-1.0.20060302.ebuild,
+ mplayer-1.0.20060408.ebuild, mplayer-1.0.20060415.ebuild:
+ -alpha and -amd64 all snapshots wrt Bug #136520.
+
+ 28 Jun 2006; Thomas Cort <tcort@gentoo.org> mplayer-1.0_pre8.ebuild:
+ Stable on alpha wrt Bug #136520.
+
+ 27 Jun 2006; Guy Martin <gmsoft@gentoo.org> mplayer-1.0_pre8.ebuild,
+ mplayer-1.0.20060217.ebuild, mplayer-1.0.20060408.ebuild,
+ mplayer-1.0.20060415.ebuild:
+ Stable on hppa.
+
+ 25 Jun 2006; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre8.ebuild:
+ phase out nls, unicode triggers iconv dep
+
+ 25 Jun 2006; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre8.ebuild:
+ set charset to noconv if you disable unicode
+
+ 25 Jun 2006; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre8.ebuild:
+ make debug more useful
+
+ 22 Jun 2006; Fabian Groffen <grobian@gentoo.org> mplayer-1.0_pre8.ebuild:
+ Marked ~ppc-macos, I'm stunned (bug #107795)
+
+ 19 Jun 2006; Gustavo Zacarias <gustavoz@gentoo.org>
+ mplayer-1.0.20060102.ebuild, mplayer-1.0.20060217.ebuild,
+ mplayer-1.0.20060302.ebuild, mplayer-1.0.20060408.ebuild,
+ mplayer-1.0.20060415.ebuild:
+ -sparc snapshot versions to let pre8 win
+
+ 16 Jun 2006; Jason Wever <weeve@gentoo.org> mplayer-1.0_pre8.ebuild:
+ Stable on SPARC wrt bug #136520.
+
+ 16 Jun 2006; Patrick McLean <chutzpah@gentoo.org> mplayer-1.0_pre8.ebuild:
+ Stable on amd64 (bug #136520).
+
+ 14 Jun 2006; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre8.ebuild,
+ mplayer-1.0.20060102.ebuild, mplayer-1.0.20060217.ebuild,
+ mplayer-1.0.20060302.ebuild, mplayer-1.0.20060408.ebuild,
+ mplayer-1.0.20060415.ebuild:
+ pre8 stable for ppc and ppc64
+
+ 14 Jun 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060102.ebuild, mplayer-1.0.20060217.ebuild,
+ mplayer-1.0.20060302.ebuild, mplayer-1.0.20060408.ebuild,
+ mplayer-1.0.20060415.ebuild:
+ -x86 on the snapshots to leave the new release available for public
+ consumption, enjoy
+
+ 13 Jun 2006; Markus Rothe <corsair@gentoo.org> mplayer-1.0_pre8.ebuild:
+ Stable on ppc64; bug #136520
+
+ 12 Jun 2006; Chris Gianelloni <wolf31o2@gentoo.org>
+ mplayer-1.0_pre8.ebuild:
+ Stable on x86 wrt bug #136520.
+
+ 12 Jun 2006; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre8.ebuild:
+ x264 dep updated
+
+*mplayer-1.0_pre8 (11 Jun 2006)
+
+ 11 Jun 2006; Luca Barbato <lu_zero@gentoo.org> +mplayer-1.0_pre8.ebuild:
+ New release
+
+ 10 Jun 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060415.ebuild:
+ typo for the speex support fixed, see bug #136287, thanks to Adam Jones
+ <adam@yggdrasl.demon.co.uk> for spotting it
+
+ 10 May 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060415.ebuild:
+ Added speex useflag, thanks to Roman Polach <rpolach@atlas.cz> for spotting
+ it.
+
+ 03 May 2006; Diego Pettenò <flameeyes@gentoo.org> metadata.xml:
+ Update metadata to list media-video@gentoo.org as maintainer.
+
+ 30 Apr 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060415.ebuild:
+ Blue skin updated
+
+ 29 Apr 2006; Luis Medinas <metalgod@gentoo.org>
+ mplayer-1.0.20060415.ebuild:
+ Stable on amd64. For security bug #127969.
+
+ 27 Apr 2006; Marien Zwart <marienz@gentoo.org>
+ files/digest-mplayer-1.0_pre7-r1, files/digest-mplayer-1.0.20060102,
+ files/digest-mplayer-1.0.20060217, files/digest-mplayer-1.0.20060302,
+ Manifest:
+ Fixing SHA256 digest, pass four
+
+ 22 Apr 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060415.ebuild:
+ Overall fixes, spotted on NetBSD
+
+ 20 Apr 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060415.ebuild:
+ LINGUAS disabled
+
+ 17 Apr 2006; Markus Rothe <corsair@gentoo.org>
+ mplayer-1.0.20060415.ebuild:
+ Stable on ppc64; bug #127969
+
+ 17 Apr 2006; Rene Nussbaumer <killerfox@gentoo.org>
+ mplayer-1.0.20060415.ebuild:
+ Stable on hppa. See bug #127969.
+
+ 17 Apr 2006; Tobias Scherbaum <dertobi123@gentoo.org>
+ mplayer-1.0.20060415.ebuild:
+ ppc stable, bug #127969
+
+ 17 Apr 2006; Joshua Jackson <tsunam@gentoo.org>
+ mplayer-1.0.20060408.ebuild, mplayer-1.0.20060415.ebuild:
+ Stable on x86; security bug #127969
+
+ 16 Apr 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060415.ebuild:
+ Fixed SRC_URI, as pointed in bug #130071
+
+ 16 Apr 2006; Luca Barbato <lu_zero@gentoo.org>
+ files/gcc-3-register_allocation.patch:
+ Patch updated
+
+ 16 Apr 2006; Luca Barbato <lu_zero@gentoo.org>
+ +files/gcc-3-register_allocation.patch, mplayer-1.0.20060415.ebuild:
+ Fixed a typo in the gcc workarounds triggering an ICE on gcc-3.
+
+ 16 Apr 2006; Jason Wever <weeve@gentoo.org> mplayer-1.0.20060415.ebuild:
+ Stable on SPARC wrt security bug #127969.
+
+ 15 Apr 2006; Thomas Cort <tcort@gentoo.org> ChangeLog:
+ Stable on alpha wrt security Bug #127969.
+
+ 15 Apr 2006; Joshua Jackson <tsunam@gentoo.org>
+ mplayer-1.0.20060408.ebuild, mplayer-1.0.20060415.ebuild:
+ Stable on x86; bug #127969
+
+*mplayer-1.0.20060415 (14 Apr 2006)
+
+ 14 Apr 2006; Luca Barbato <lu_zero@gentoo.org>
+ +mplayer-1.0.20060415.ebuild:
+ New snapshot LANG related issue corrected
+
+ 11 Apr 2006; Joshua Jackson <tsunam@gentoo.org>
+ mplayer-1.0.20060408.ebuild:
+ Stable for security bug #127969
+
+ 09 Apr 2006; Rene Nussbaumer <killerfox@gentoo.org>
+ mplayer-1.0.20060408.ebuild:
+ Stable on hppa. See bug #127969.
+
+ 09 Apr 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060408.ebuild:
+ Deps update
+
+ 08 Apr 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060408.ebuild:
+ Lots of fixed related to the new unicode support and vidix support
+
+*mplayer-1.0.20060408 (08 Apr 2006)
+
+ 08 Apr 2006; Luca Barbato <lu_zero@gentoo.org>
+ +mplayer-1.0.20060408.ebuild:
+ New snapshot
+
+ 02 Apr 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060302.ebuild:
+ Proper fix for bug #127901, solves bug #128410
+
+ 31 Mar 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060302.ebuild:
+ Workaround for the new dvdnav, fixes bug #127901 thanks to Ed Catmur
+ <ed@catmur.co.uk> for pointing out
+
+ 24 Mar 2006; Aron Griffis <agriffis@gentoo.org>
+ mplayer-1.0.20060302.ebuild:
+ Mark 1.0.20060302 stable on ia64
+
+ 19 Mar 2006; Fernando J. Pereda <ferdy@gentoo.org>
+ mplayer-1.0.20060302.ebuild:
+ Stable on alpha wrt bug #126627. Thanks to both Mike Hlavac
+ <mike@flyingpenguins.org> and Thomas Cort <tcort@cs.ubishops.ca>
+
+ 18 Mar 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060302.ebuild:
+ bsd related changes
+
+ 03 Mar 2006; Rene Nussbaumer <killerfox@gentoo.org>
+ mplayer-1.0.20060217.ebuild:
+ Stable on hppa. See bug #115760.
+
+ 03 Mar 2006; Fernando J. Pereda <ferdy@gentoo.org>
+ mplayer-1.0.20060302.ebuild:
+ Re-add ~alpha keyword wrt bug #124776. Tested by Thomas Cort
+ <tcort@cs.ubishops.ca>
+
+ 26 Feb 2006; Bryan Østergaard <kloeri@gentoo.org
+ mplayer-1.0.20060217.ebuild:
+ Stable on alpha, bug 115760.
+
+*mplayer-1.0.20060302 (02 Mar 2006)
+
+ 02 Mar 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060217.ebuild, +mplayer-1.0.20060302.ebuild:
+ openal removed again from 20060217, since could not work for everybody, new
+ snapshot with fixes and x264 support
+
+ 22 Feb 2006; Aron Griffis <agriffis@gentoo.org>
+ mplayer-1.0.20060217.ebuild:
+ Mark 1.0.20060217 stable on ia64. #115760
+
+ 22 Feb 2006; Tobias Scherbaum <dertobi123@gentoo.org>
+ mplayer-1.0.20060217.ebuild:
+ ppc stable, bug #115760
+
+ 22 Feb 2006; Markus Rothe <corsair@gentoo.org>
+ mplayer-1.0.20060217.ebuild:
+ Stable on ppc64; bug #115760
+
+ 22 Feb 2006; Herbie Hopkins <herbs@gentoo.org>
+ mplayer-1.0.20060217.ebuild:
+ Stable on amd64 wrt bug #115760.
+
+ 22 Feb 2006; Joshua Jackson <tsunam@gentoo.org>
+ mplayer-1.0.20060217.ebuild:
+ Stable on x86; Security bug #115760
+
+ 20 Feb 2006; Gustavo Zacarias <gustavoz@gentoo.org>
+ mplayer-1.0.20060217.ebuild:
+ Stable on sparc wrt security #115760
+
+ 21 Feb 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060217.ebuild:
+ Fixed some of the logic, openal should work now, thanks to Reimar for
+ helping, as usual
+
+ 20 Feb 2006; Luca Barbato <lu_zero@gentoo.org>
+ -files/mmst_fix_20050415.diff, -files/rtsp_fix_20050415.diff,
+ mplayer-1.0.20060217.ebuild:
+ fixed faad autodetection
+
+ 17 Feb 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060217.ebuild:
+ openal disabled, pending update
+
+*mplayer-1.0.20060217 (17 Feb 2006)
+
+ 17 Feb 2006; Luca Barbato <lu_zero@gentoo.org>
+ +mplayer-1.0.20060217.ebuild:
+ New snapshot
+
+ 15 Feb 2006; Diego Pettenò <flameeyes@gentoo.org>
+ mplayer-1.0_pre7-r1.ebuild, mplayer-1.0.20060102.ebuild:
+ Put gettext as a build-time dependency, and use virtual/libintl as RDEPEND
+ instead.
+
+ 13 Feb 2006; Patrick McLean <chutzpah@gentoo.org>
+ mplayer-1.0.20060102.ebuild:
+ Add "musepack" USE flag to support the musepack audio codec (bug #122081).
+
+ 03 Feb 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060102.ebuild:
+ dvb changes
+
+ 26 Jan 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060102.ebuild:
+ gtk2 support as default
+
+ 06 Jan 2006; Luca Barbato <lu_zero@gentoo.org>
+ mplayer-1.0.20060102.ebuild:
+ mythtv useflag removed since the patch got incorporated as stated in bug
+ #117725
+
+ 03 Jan 2006; Daniel Black <dragonheart@gentoo.org>
+ mplayer-1.0_pre7-r1.ebuild, mplayer-1.0.20060102.ebuild:
+ dependency changed to =dev-libs/lzo-1* so that unmasking lzo-2 will not
+ break this package as per bug #112374
+
+*mplayer-1.0.20060102 (03 Jan 2006)
+
+ 03 Jan 2006; Luca Barbato <lu_zero@gentoo.org>
+ +mplayer-1.0.20060102.ebuild:
+ Snapshot version
+
+ 12 Dec 2005; Donnie Berkholz <spyderous@gentoo.org>;
+ mplayer-1.0_pre7-r1.ebuild:
+ (#110990) Add modular X dependencies.
+
+ 03 Dec 2005; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre7-r1.ebuild:
+ Typo fixed, thanks Oldrich Jedlicka <oldium.pro@seznam.cz> for reporting
+
+ 03 Dec 2005; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre7-r1.ebuild:
+ livecd and bindist support, minor changes overall
+
+ 01 Nov 2005; Luca Barbato <lu_zero@gentoo.org>
+ -files/mplayer-1.0_pre6-codecs.patch,
+ -files/mplayer-1.0_pre6-configure.patch,
+ -files/mplayer-1.0_pre6-pic.patch, -files/mplayer-1.0_pre6-ppc64.patch,
+ +files/mplayer-1.0_pre7-ppc64.patch, -files/mplayer-avi_crash.patch,
+ -files/mplayer-gcc_detection.patch, -files/mplayer-jack.patch,
+ -files/mplayer-nl.patch, -mplayer-1.0_pre6-r4.ebuild,
+ -mplayer-1.0_pre6-r5.ebuild, -mplayer-1.0_pre6-r6.ebuild,
+ -mplayer-1.0_pre7.ebuild, mplayer-1.0_pre7-r1.ebuild:
+ Complete cleanup
+
+ 01 Nov 2005; Luca Barbato <lu_zero@gentoo.org>
+ -mplayer-1.0_pre6-r4.ebuild, -mplayer-1.0_pre6-r5.ebuild,
+ -mplayer-1.0_pre6-r6.ebuild:
+ Pruning mplayer-1.0_pre6 ebuilds
+
+ 31 Oct 2005; Diego Pettenò <flameeyes@gentoo.org>
+ mplayer-1.0_pre6-r4.ebuild, mplayer-1.0_pre6-r5.ebuild,
+ mplayer-1.0_pre6-r6.ebuild, mplayer-1.0_pre7.ebuild:
+ Disable divx4linux in every version, not just the last one, to avoid
+ breakage now that the package is gone.
+
+ 30 Oct 2005; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre7-r1.ebuild:
+ Removed ancient divx4linux support, internal support if far better anyway.
+
+ 06 Nov 2005; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre7-r1.ebuild:
+ disable x264 for now
+
+ 10 Oct 2005; Luca Barbato <lu_zero@gentoo.org>
+ +files/mplayer-1.0_pre7-gcc4-amd64.patch, mplayer-1.0_pre7-r1.ebuild:
+ Fix for gcc-4.0.1 and amd64
+
+ 31 Aug 2005; Aron Griffis <agriffis@gentoo.org>
+ mplayer-1.0_pre7-r1.ebuild:
+ stable on alpha #103555
+
+ 31 Aug 2005; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre7-r1.ebuild:
+ Cleanup
+
+ 30 Aug 2005; Ian Leitch <port001@gentoo.org> mplayer-1.0_pre7-r1.ebuild:
+ Stable on x86, bug #103555
+
+ 30 Aug 2005; Gustavo Zacarias <gustavoz@gentoo.org>
+ mplayer-1.0_pre7-r1.ebuild:
+ Stable on sparc wrt #103555
+
+ 28 Aug 2005; Marcus D. Hanwell <cryos@gentoo.org>
+ mplayer-1.0_pre7-r1.ebuild:
+ Stable on amd64 wrt bug 103555.
+
+ 27 Aug 2005; Markus Rothe <corsair@gentoo.org> mplayer-1.0_pre7-r1.ebuild:
+ Stable on ppc64 (bug #103555)
+
+ 27 Aug 2005; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre7-r1.ebuild:
+ Marked ppc
+
+*mplayer-1.0_pre7-r1 (27 Aug 2005)
+
+ 27 Aug 2005; Luca Barbato <lu_zero@gentoo.org>
+ +mplayer-1.0_pre7-r1.ebuild:
+ Hotfix release for a recently discovered buffer overflow, bug #103555
+
+ 25 Aug 2005; Aron Griffis <agriffis@gentoo.org> mplayer-1.0_pre7.ebuild:
+ stable on ia64
+
+ 04 Aug 2005; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre7.ebuild:
+ Removed the libmatroska dep, fixes bug #99024, thanks to Giacomo Perale
+ <ghepeu@virgilio.it> for pointing out
+
+ 04 Aug 2005; Luca Barbato <lu_zero@gentoo.org> files/mplayer.desktop:
+ Fix for the .desktop file, bug #98268
+
+ 25 May 2005; Herbie Hopkins <herbs@gentoo.org> mplayer-1.0_pre7.ebuild:
+ Multilib fix, bad path to libxmms.
+
+ 16 May 2005; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre6-r6.ebuild,
+ mplayer-1.0_pre7.ebuild:
+ Fix bug #92751
+
+ 10 May 2005; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre7.ebuild:
+ aalib support fixed
+
+ 09 May 2005; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre6-r6.ebuild,
+ mplayer-1.0_pre7.ebuild:
+ 3dfx requires dga. Fix for bug #91351
+
+ 09 May 2005; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre6-r6.ebuild,
+ mplayer-1.0_pre7.ebuild:
+ Purge problematic cflag
+
+ 09 May 2005; Luca Barbato <lu_zero@gentoo.org>
+ files/mplayer-gcc_detection.patch:
+ Simpler gcc_detection patch, update from Diego Biurrun
+
+ 09 May 2005; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre6-r6.ebuild,
+ mplayer-1.0_pre7.ebuild:
+ Minor updates
+
+ 06 May 2005; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre6-r6.ebuild,
+ mplayer-1.0_pre7.ebuild:
+ Fix the ebuilds to enable cpudetection correctly, thanks to Emanuele
+ Giaquinta <emanuele.giaquinta@gmail.com>
+
+ 05 May 2005; Aron Griffis <agriffis@gentoo.org> mplayer-1.0_pre6-r5.ebuild,
+ mplayer-1.0_pre6-r6.ebuild, mplayer-1.0_pre7.ebuild:
+ add ~ia64
+
+ 05 May 2005; Jan Brinkmann <luckyduck@gentoo.org>
+ -files/mplayer-0.90-coreutils-fixup.patch, -files/mplayer-1.0-gtk2.patch,
+ -files/mplayer-1.0_pre5-alsa-gcc34.patch,
+ -files/mplayer-1.0_pre5-bio2jack.patch,
+ -files/mplayer-1.0_pre5-configure.patch,
+ -files/mplayer-1.0_pre5-gcc_detection.patch,
+ -files/mplayer-1.0_pre5-help_mp-ro.h.patch,
+ -files/mplayer-1.0_pre5-live.patch,
+ -files/mplayer-1.0_pre5-mga-kernel-2.6.patch,
+ -files/mplayer-1.0_pre5-mips64.patch,
+ -files/mplayer-1.0_pre5-r1-conf_locale.patch,
+ -files/mplayer-1.0_pre5-r4-ppc64.patch,
+ -files/mplayer-1.0_pre5-r5-configure.patch,
+ -files/mplayer-1.0_pre5-yuv2rgb_fix.patch, -files/cachefill.patch,
+ -files/gui_vuln_code.patch, -files/mplayer-gif.patch,
+ -files/mplayer-odml.patch, -files/mplayer-x11.patch,
+ -files/real_demux.patch, -files/str_undefined.patch, -files/strl.c,
+ -files/vuln02-fix.diff, -mplayer-1.0_pre5-r5.ebuild:
+ removed old vulnerable version and unneeded patches.
+
+ 25 Apr 2005; Martin Schlemmer <azarah@gentoo.org>
+ +files/mplayer-1.0_pre7-gcc4.patch,
+ +files/mplayer-1.0_pre7-gcc_detection.patch, mplayer-1.0_pre7.ebuild:
+ Fix building with gcc4. Patch from Genady Okrain (Mafteah) 's overlay (plus
+ some added fixes to libvo/aclib_template.c that whoever seemed to have
+ missed).
+
+ 21 Apr 2005; Herbie Hopkins <herbs@gentoo.org> mplayer-1.0_pre7.ebuild:
+ Same amd64 cleanup, new version.
+
+ 21 Apr 2005; Simon Stelling <blubb@gentoo.org> mplayer-1.0_pre6-r6.ebuild:
+ minor amd64-specific cleanup
+
+ 19 Apr 2005; Bryan Østergaard <kloeri@gentoo.org>
+ mplayer-1.0_pre6-r4.ebuild:
+ Stable on alpha, bug 89277.
+
+ 17 Apr 2005; Jason Wever <weeve@gentoo.org> mplayer-1.0_pre6-r4.ebuild:
+ Stable on SPARC wrt security bug #89277.
+
+ 18 Apr 2005; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre6-r6.ebuild,
+ mplayer-1.0_pre7.ebuild:
+ Minor polishing, thanks to Gurgh <gurgh@gurga.com> for the suggestions
+
+ 17 Apr 2005; Luca Barbato <lu_zero@gentoo.org>
+ +files/mplayer-1.0_pre5-alsa-gcc34.patch,
+ +files/mplayer-1.0_pre5-help_mp-ro.h.patch, mplayer-1.0_pre5-r5.ebuild,
+ mplayer-1.0_pre7.ebuild:
+ Fixed pre5 patchset
+
+ 17 Apr 2005; Markus Rothe <corsair@gentoo.org> mplayer-1.0_pre6-r4.ebuild:
+ Stable on ppc64; bug #89277
+
+*mplayer-1.0_pre7 (17 Apr 2005)
+
+ 17 Apr 2005; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre6-r6.ebuild,
+ +mplayer-1.0_pre7.ebuild:
+ New experimental ebuild and minor fix
+
+ 16 Apr 2005; Michael Hanselmann <hansmi@gentoo.org>
+ mplayer-1.0_pre6-r4.ebuild:
+ Stable on ppc.
+
+ 16 Apr 2005; Jan Brinkmann <luckyduck@gentoo.org>
+ mplayer-1.0_pre6-r4.ebuild:
+ stable on amd64 and x86 wrt #89277
+
+*mplayer-1.0_pre6-r4 (16 Apr 2005)
+
+ 16 Apr 2005; Jan Brinkmann <luckyduck@gentoo.org>
+ -mplayer-1.0_pre6-r1.ebuild, -mplayer-1.0_pre6-r2.ebuild,
+ -mplayer-1.0_pre6-r3.ebuild, +mplayer-1.0_pre6-r4.ebuild,
+ +mplayer-1.0_pre6-r5.ebuild, +mplayer-1.0_pre6-r6.ebuild:
+ updated revisions for security bug #89277
+
+ 16 Apr 2005; Jan Brinkmann <luckyduck@gentoo.org> metadata.xml,
+ +files/mmst_fix_20050415.diff, +files/rtsp_fix_20050415.diff,
+ mplayer-1.0_pre6-r1.ebuild, mplayer-1.0_pre6-r2.ebuild,
+ mplayer-1.0_pre6-r3.ebuild:
+ added 2 security related patches to the _pre6 ebuilds. see #89277. also
+ updated metadata.xml, chriswhite is retired.
+
+ 16 Apr 2005; Luca Barbato <lu_zero@gentoo.org>
+ -files/mplayer-1.0_pre4-alsa-gcc34.patch,
+ -files/mplayer-1.0_pre4-altivec-gcc34.patch,
+ -files/mplayer-1.0_pre4-help_mp-ro.h.patch,
+ -files/mplayer-1.0_pre4-mpst.patch, -mplayer-1.0_pre4-r7.ebuild,
+ -mplayer-1.0_pre5-r2.ebuild, -mplayer-1.0_pre5-r3.ebuild,
+ -mplayer-1.0_pre5-r4.ebuild, mplayer-1.0_pre5-r5.ebuild,
+ mplayer-1.0_pre6-r1.ebuild, mplayer-1.0_pre6-r2.ebuild,
+ mplayer-1.0_pre6-r3.ebuild:
+ useflag move 3dnowex -> 3dnowext, global cleanup
+
+*mplayer-1.0_pre6-r3 (12 Apr 2005)
+
+ 12 Apr 2005; Luca Barbato <lu_zero@gentoo.org>
+ +mplayer-1.0_pre6-r3.ebuild:
+ New p.masked ebuild, cpudetection and custom-cflags added.
+
+ 11 Apr 2005; Jan Brinkmann <luckyduck@gentoo.org>
+ mplayer-1.0_pre6-r1.ebuild, mplayer-1.0_pre6-r2.ebuild:
+ added support for blinkenlights, fixes #86776. we also dont install useless
+ menu entries any longer if use -gtk, fixes bug #86399
+
+ 07 Apr 2005; Jan Brinkmann <luckyduck@gentoo.org>
+ mplayer-1.0_pre6-r1.ebuild, mplayer-1.0_pre6-r2.ebuild:
+ MAKEOPTS -jN has to be -j1 for successful compilation. fixes #86245
+
+ 02 Apr 2005; Chris White <chriswhite@gentoo.org>
+ mplayer-1.0_pre6-r2.ebuild:
+ Removed april fools segment.
+
+ 01 Apr 2005; Chris White <chriswhite@gentoo.org>
+ files/mplayer-gcc_detection.patch, mplayer-1.0_pre5-r5.ebuild,
+ mplayer-1.0_pre6-r2.ebuild:
+ Fixed gcc detection patch. Converted avi USE flag to win32codecs USE flag to
+ get rid of ugly arch conditional nestings.
+
+ 22 Mar 2005; Chris White <chriswhite@gentoo.org>
+ mplayer-1.0_pre6-r2.ebuild:
+ Fixing bug #85861 as well as changing over to 3dnowext to match the cpu flag
+ in mplayer-1.0_pre6-r2.
+
+ 22 Mar 2005; Chris White <chriswhite@gentoo.org>
+ files/mplayer-1.0_pre6-pic.patch:
+ Fixing the pic patch for reals this time.
+
+ 21 Mar 2005; Chris White <chriswhite@gentoo.org>
+ files/mplayer-1.0_pre6-pic.patch:
+ Fix 3dnow conditional for idcmt 3dnow unresolved errors.
+
+*mplayer-1.0_pre6-r2 (21 Mar 2005)
+
+ 21 Mar 2005; Chris White <chriswhite@gentoo.org>
+ +files/mplayer-1.0_pre6-pic.patch, +mplayer-1.0_pre6-r2.ebuild:
+ The big closer. Bug #51853 goes bye bye. MPlayer will now compile with pic
+ and x86 without filtration.
+
+ 20 Mar 2005; Chris White <chriswhite@gentoo.org>
+ mplayer-1.0_pre6-r1.ebuild:
+ Fix bug #85945 (no longer need the alsa-gui patch for pre6).
+
+ 20 Mar 2005; Chris White <chriswhite@gentoo.org>
+ mplayer-1.0_pre5-r5.ebuild:
+ Fixed bad if logic (must be getting good at this :|) for real codecs.
+
+ 19 Mar 2005; Guy Martin <gmsoft@gentoo.org> mplayer-1.0_pre6-r1.ebuild:
+ Stable on hppa.
+
+ 19 Mar 2005; Chris White <chriswhite@gentoo.org>
+ mplayer-1.0_pre6-r1.ebuild:
+ Forgot the mmxext params in ecpu_check for pre6-r1.
+
+*mplayer-1.0_pre6-r1 (19 Mar 2005)
+
+ 19 Mar 2005; Chris White <chriswhite@gentoo.org>
+ +files/mplayer-1.0_pre6-codecs.patch, mplayer-1.0_pre4-r7.ebuild,
+ mplayer-1.0_pre5-r3.ebuild, mplayer-1.0_pre5-r4.ebuild,
+ mplayer-1.0_pre5-r5.ebuild, +mplayer-1.0_pre6-r1.ebuild,
+ -mplayer-1.0_pre6.ebuild:
+ Fixed bugs #85642 #85534 #83609 #83546. Pre6 gets a revbump because it uses
+ RealPlayer's codecs instead of win32codecs and because of new 3gp codec
+ support. Old pre6 goes bye bye. mmx2->mmxext.
+
+ 16 Mar 2005; Chris White <chriswhite@gentoo.org>
+ +files/mplayer-1.0_pre5-gcc_detection.patch, mplayer-1.0_pre5-r3.ebuild:
+ Fixed optimization logics for mips, hopefully solving bug #83633. Added gcc
+ detection patch to make mplayer actually compile.
+
+ 16 Mar 2005; Chris White <chriswhite@gentoo.org>
+ mplayer-1.0_pre5-r3.ebuild:
+ Fixed mplayer-1.0_pre5-r3's message about not using custom CFLAGS. Put in
+ the strip-flags which is supposed to be in there.
+
+ 24 Feb 2005; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre6.ebuild:
+ Re-added x86 only USE flag logic for win32codecs. Fixes #82535.
+
+ 19 Feb 2005; Chris White <chriswhite@gentoo.org>
+ +files/mplayer-gcc_detection.patch, +files/mplayer-jack.patch,
+ mplayer-1.0_pre6.ebuild:
+ Fixed endianess issues with jack output. Fixed gcc being detected improperly.
+
+ 07 Feb 2005; Jan Brinkmann <luckyduck@gentoo.org>
+ mplayer-1.0_pre5-r5.ebuild:
+ use_enable avi should only be possible on x86. fixed #81149
+
+ 07 Feb 2005; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre6.ebuild:
+ Repoman fix trailing white space.
+
+ 07 Feb 2005; Chris White <chriswhite@gentoo.org> files/mplayer.desktop,
+ mplayer-1.0_pre5-r5.ebuild, mplayer-1.0_pre6.ebuild:
+ Fixed bug #65914 (desktop file) bug #79207 (real libs logic) bug #78481 (avi
+ USE flag for win32codecs).
+
+ 07 Feb 2005; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r5.ebuild,
+ mplayer-1.0_pre6.ebuild:
+ Added dga logic to fix bug #80861.
+
+ 06 Feb 2005; Chris White <chriswhite@gentoo.org> files/mplayer-x11.patch:
+ Fixing the patch to work with 71478's issue as well.
+
+ 06 Feb 2005; Chris White <chriswhite@gentoo.org> +files/mplayer-x11.patch,
+ mplayer-1.0_pre5-r5.ebuild, mplayer-1.0_pre6.ebuild:
+ Fixed bug #80564 with a patch by nickc and removed uneeded deps on portage and
+ nasm.
+
+ 06 Feb 2005; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r5.ebuild,
+ mplayer-1.0_pre6.ebuild:
+ Apparently mmx2 shows up in /proc/cpuinfo as mmxext, so disabling mmx2 cpu
+ checking until I can rework ecpu_check to handle this properly.
+
+ 05 Feb 2005; Chris White <chriswhite@gentoo.org> +files/mplayer-gif.patch,
+ mplayer-1.0_pre5-r5.ebuild:
+ Fixed giflib support by backing mplayer pre6 giflib detection.
+
+ 04 Feb 2005; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r5.ebuild,
+ mplayer-1.0_pre6.ebuild:
+ Re-enabled sse2 as people with x86's say it works ok. Enabled new
+ ecpu_check-ing functionality.
+
+ 30 Jan 2005; Chris White <chriswhite@gentoo.org>
+ +files/mplayer-avi_crash.patch, mplayer-1.0_pre5-r5.ebuild,
+ mplayer-1.0_pre6.ebuild:
+ Fixed bugs #79243 and 78337.
+
+ 30 Jan 2005; Chris White <chriswhite@gentoo.org>
+ mplayer-1.0_pre5-r5.ebuild, mplayer-1.0_pre6.ebuild:
+ altivec fix for #76559.
+
+ 30 Jan 2005; Chris White <chriswhite@gentoo.org>
+ mplayer-1.0_pre5-r5.ebuild, mplayer-1.0_pre6.ebuild:
+ Fixed real being force enabled (instead of USE flag configured..) and
+ RESTRICT=nostrip to hopefully fix bug #71672.
+
+ 24 Jan 2005; Jan Brinkmann <luckyduck@gentoo.org> mplayer-1.0_pre6.ebuild:
+ added dv to IUSE, it was already used by the ebuild. fixes bug #79319
+
+ 23 Jan 2005; Jan Brinkmann <luckyduck@gentoo.org>
+ mplayer-1.0_pre5-r5.ebuild, mplayer-1.0_pre6.ebuild:
+ applied patch to make distcc compiling possible. fixes bug #77235
+
+ 23 Jan 2005; Chris White <chriswhite@gentoo.org>
+ mplayer-1.0_pre5-r5.ebuild, mplayer-1.0_pre6.ebuild:
+ Fixed bug #78209. Also removed the gif lib logic in pre6 as it's no longer
+ required (fixed upstream) and now gif is a true enable/disable style flag.
+
+ 23 Jan 2005; Chris White <chriswhite@gentoo.org> +files/mplayer-nl.patch,
+ mplayer-1.0_pre6.ebuild:
+ Fixed bug #76429. Added mplayer-nl.patch to solve.
+
+ 23 Jan 2005; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r4.ebuild,
+ mplayer-1.0_pre5-r5.ebuild, mplayer-1.0_pre6.ebuild:
+ Fixed dk from Swedish to Danish.
+
+ 14 Jan 2005; Sven Wegener <swegener@gentoo.org>
+ mplayer-1.0_pre5-r5.ebuild, mplayer-1.0_pre6.ebuild:
+ Added missing ? in *DEPEND.
+
+ 14 Jan 2005; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r5.ebuild,
+ mplayer-1.0_pre6.ebuild:
+ Re-fixing gif logic (someone messed with it :|) to fix #77463.
+
+ 11 Jan 2005; Danny van Dyk <kugelfang@gentoo.org> mplayer-1.0_pre6.ebuild:
+ mplayer now contains SIMD assembler code for AMD64. The AMD64 Team decided
+ to hard-enable SIMD assembler for all users.
+
+ 11 Jan 2005; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre6.ebuild:
+ Adding anti-sse2 until someone tells me it doesn't create strange code.
+
+ 09 Jan 2005; Jan Brinkmann <luckyduck@gentoo.org>
+ mplayer-1.0_pre5-r4.ebuild, mplayer-1.0_pre5-r5.ebuild,
+ mplayer-1.0_pre6.ebuild:
+ made some trivial changes to the alsa related warning in pkg_postinst. fixes
+ bug #76469.
+
+ 07 Jan 2005; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r5.ebuild,
+ mplayer-1.0_pre6.ebuild:
+ Re-adding pic logic in (bad chris) and also getting strip-flags added to
+ pre5-r5.
+
+ 06 Jan 2005; Patrick Kursawe <phosphan@gentoo.org> mplayer-1.0_pre6.ebuild:
+ Fixed unpack problem (bug #76854)
+
+ 06 Jan 2005; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre6.ebuild:
+ MPlayer pre6 was missing docs upstream, adding an 'a' prefix to get the latest
+ alpha version that contains the docs. Note that none of the actual code was
+ changed.
+
+ 29 Dec 2004; Ciaran McCreesh <ciaranm@gentoo.org> :
+ Change encoding to UTF-8 for GLEP 31 compliance
+
+ 27 Dec 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre6.ebuild:
+ Fixed dts -> libdts configure option as per bug #75762.
+
+ 27 Dec 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre6.ebuild:
+ Added dts support back per bug #75669. Also fixed libdv being forced
+ required as per bug #72146.
+
+ 27 Dec 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre6.ebuild:
+ Fixed bio2jack dep issues as per bug #75720. Also force enabled networking
+ support as it causes more issues then solves them.
+
+ 27 Dec 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre6.ebuild:
+ tossing in -frename-registers as per bug #75690. Tested it to make sure it
+ wouldn't make hardened gcc cry with BREG errors.
+
+*mplayer-1.0_pre6 (26 Dec 2004)
+
+ 26 Dec 2004; Chris White <chriswhite@gentoo.org>
+ +files/mplayer-1.0_pre6-configure.patch,
+ +files/mplayer-1.0_pre6-ppc64.patch, +mplayer-1.0_pre6.ebuild:
+ Infamous 1.0_pre6 bump.
+
+ 19 Dec 2004; Bryan Østergaard <kloeri@gentoo.org>
+ mplayer-1.0_pre5-r5.ebuild:
+ Stable on alpha, bug 74473.
+
+ 18 Dec 2004; Jason Wever <weeve@gentoo.org> mplayer-1.0_pre5-r5.ebuild:
+ Stable on sparc wrt security bug #74473.
+
+ 19 Dec 2004; Michael Hanselmann <hansmi@gentoo.org>
+ mplayer-1.0_pre5-r5.ebuild:
+ Stable on ppc.
+
+ 18 Dec 2004; Dylan Carlson <absinthe@gentoo.org>
+ mplayer-1.0_pre5-r5.ebuild:
+ Stable on amd64.
+
+ 18 Dec 2004; Markus Rothe <corsair@gentoo.org> mplayer-1.0_pre5-r5.ebuild:
+ Stable on ppc64; bug #74473
+
+ 19 Dec 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r5.ebuild:
+ Arrg, forgot to bump down ppc64 keywords :|.
+
+*mplayer-1.0_pre5-r5 (19 Dec 2004)
+
+ 19 Dec 2004; Chris White <chriswhite@gentoo.org>
+ +files/mplayer-1.0_pre5-r5-configure.patch, mplayer-1.0_pre4-r7.ebuild,
+ mplayer-1.0_pre5-r2.ebuild, mplayer-1.0_pre5-r3.ebuild,
+ +mplayer-1.0_pre5-r5.ebuild:
+ Bumping to pre5-r5 as per bug #74473. Tested on 20 randomly encoded .avis,
+ mp3s, and even streaming video/audio. Marked x86 stable.
+
+ 17 Dec 2004; Markus Rothe <corsair@gentoo.org> mplayer-1.0_pre5-r4.ebuild:
+ Stable on ppc64
+
+ 02 Dec 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r4.ebuild:
+ vo -> ao in alsa warning.
+
+ 14 Nov 2004; Markus Rothe <corsair@gentoo.org>
+ +files/mplayer-1.0_pre5-r4-ppc64.patch, mplayer-1.0_pre5-r4.ebuild:
+ Marked ~ppc64 (bug #68112) and added ppc64 patch.
+
+ 11 Nov 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r4.ebuild:
+ Copied midentify to /usr/bin for emovix for bug #58580.
+
+ 11 Nov 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r7.ebuild,
+ mplayer-1.0_pre5-r4.ebuild:
+ Removed mga buiding in MPlayer due to reasons in bug #28846.
+
+ 10 Nov 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r4.ebuild:
+ Lots of fancy bash scripting to make MPlayer deal with the normal (and proper)
+ LINGUAS format. Closes bug #49710.
+
+ 10 Nov 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r4.ebuild:
+ Added a message about the alsa -ao format to postinstall. Closes bug #57256.
+
+ 10 Nov 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r7.ebuild,
+ mplayer-1.0_pre5-r2.ebuild, mplayer-1.0_pre5-r3.ebuild,
+ mplayer-1.0_pre5-r4.ebuild:
+ Fixed tdfxvid output logic as per bug #64218.
+
+ 06 Nov 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r4.ebuild:
+ Added a real USE flag warning to -pre5-r4.
+
+ 06 Nov 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r7.ebuild,
+ mplayer-1.0_pre5-r4.ebuild:
+ Fixed optimization filtering per bug #70175.
+
+ 31 Oct 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r7.ebuild,
+ mplayer-1.0_pre5-r2.ebuild, mplayer-1.0_pre5-r4.ebuild:
+ Added filtering for -falign-functions. Thanks to jstubbs for pointing that
+ out.
+
+ 24 Oct 2004; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre5-r3.ebuild,
+ mplayer-1.0_pre5-r4.ebuild:
+ Minor cleanup
+
+ 24 Oct 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r7.ebuild,
+ mplayer-1.0_pre5-r4.ebuild:
+ Converted to kernel-mod eclass. Thanks to Stefan Schweizer
+ <sschweizer@gmail.com> for helping out with that in bug #68444.
+
+ 24 Oct 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r7.ebuild:
+ Bad bash logic... [ v. ).
+
+ 24 Oct 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r4.ebuild:
+ Added some minor font functionality as per bug #48440.
+
+ 24 Oct 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r4.ebuild:
+ Finished off Bug #61451 and closed bug #68552.
+
+ 24 Oct 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r7.ebuild:
+ Alpha stable marked live, so changing the dep/patch logic for it. Only amd64
+ left and this ebuild will look ok again.
+
+ 24 Oct 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r7.ebuild:
+ Fixed Live issues in Bug #68649 and half solved configure issues in Bug #61451
+ regarding real directories.
+
+ 23 Oct 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r2.ebuild:
+ Fixed epatch issues.
+
+ 22 Oct 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r7.ebuild:
+ Fixed some more filtering that needed to be done for pic stuff to work.
+
+ 20 Oct 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r7.ebuild,
+ mplayer-1.0_pre5-r4.ebuild:
+ Fixed some xvidix logic as per bug #28865.
+
+ 19 Oct 2004; Chris White <chriswhite@gentoo.org> :
+ Did filter flags on a few problematic flags as per Bug #67903.
+
+ 17 Oct 2004; Bryan Østergaard <kloeri@gentoo.org>
+ mplayer-1.0_pre5-r3.ebuild:
+ alpha happiness, bug 66571.
+
+ 17 Oct 2004; Chris White <chriswhite@gentoo.org> :
+ Fixed digest issues :|. Removed ia64 keyword per Bug #67836.
+
+ 16 Oct 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r7.ebuild,
+ mplayer-1.0_pre5-r2.ebuild, mplayer-1.0_pre5-r3.ebuild,
+ mplayer-1.0_pre5-r4.ebuild:
+ Removed sse2 as it's broken. Custom CFLAGS now holds. Ncurses as default
+ terminal lib as per bug #64212.
+
+ 15 Oct 2004; Seemant Kulleen <seemant@gentoo.org>
+ files/mplayer-1.0_pre5-yuv2rgb_fix.patch:
+ fix the yuv2rgb patch to work properly on altivec enabled ppc's
+
+ 06 Oct 2004; Jeremy Huddleston <eradicator@gentoo.org>
+ mplayer-1.0_pre5-r3.ebuild, mplayer-1.0_pre5-r4.ebuild:
+ get_libdir fixes.
+
+ 07 Oct 2004; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre5-r3.ebuild:
+ Backport yuv2rgb_fix
+
+ 05 Oct 2004; Luca Barbato <lu_zero@gentoo.org>
+ -files/mplayer-1.0_pre5-yuv2rbg_fix.patch,
+ -files/mplayer-1.0_pre5-yuv2rbg_kludge.patch,
+ +files/mplayer-1.0_pre5-yuv2rgb_fix.patch, mplayer-1.0_pre5-r4.ebuild:
+ Hopefully the latest fix to that part
+
+ 04 Oct 2004; Luca Barbato <lu_zero@gentoo.org>
+ +files/mplayer-1.0_pre5-yuv2rbg_fix.patch, mplayer-1.0_pre5-r4.ebuild:
+ Eventually I fixed the yuv2rgb_altivec for vo_x11, the other scalers could
+ have wrong colours
+
+ 05 Oct 2004; Luca Barbato <lu_zero@gentoo.org>
+ -files/mplayer-1.0_pre5-yuv2rbg_kludge.patch,
+ +files/mplayer-1.0_pre5-yuv2rgb_fix.patch, mplayer-1.0_pre5-r4.ebuild:
+ Hopefully the latest fix to that part
+
+ 03 Oct 2004; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre5-r4.ebuild:
+ Eventually I fixed the yuv2rgb_altivec for vo_x11, the other scalers could
+ have wrong colours
+
+ 27 Sep 2004; Jeremy Huddleston <eradicator@gentoo.org>
+ mplayer-1.0_pre5-r3.ebuild:
+ Moved jack support back to -r3 to fix compilation on systems with jack
+ installed.
+
+ 22 Sep 2004; Michael Sterrett <mr_bones_@gentoo.org>
+ mplayer-1.0_pre5-r4.ebuild:
+ dev-libs/bio2jack -> media-libs/bio2jack
+
+ 06 Sep 2004; Ciaran McCreesh <ciaranm@gentoo.org>
+ mplayer-1.0_pre4-r7.ebuild, mplayer-1.0_pre5-r2.ebuild,
+ mplayer-1.0_pre5-r3.ebuild:
+ Switch to use epause and ebeep, bug #62950
+
+ 29 Aug 2004; Luca Barbato <lu_zero@gentoo.org>
+ +files/mplayer-1.0_pre5-bio2jack.patch, mplayer-1.0_pre5-r4.ebuild:
+ Jack support
+
+ 25 Aug 2004; Hardave Riar <hardave@gentoo.org> mplayer-1.0_pre5-r3.ebuild:
+ Added ~mips keyword.
+
+ 25 Aug 2004; Chris White <chriswhite@gentoo.org>
+ +files/mplayer-1.0_pre5-mips64.patch, mplayer-1.0_pre5-r3.ebuild:
+ Added mips64 patch. Closes bug #61466.
+
+*mplayer-1.0_pre5-r4 (22 Aug 2004)
+
+ 22 Aug 2004; Chris White <chriswhite@gentoo.org>
+ +files/mplayer-1.0_pre5-configure.patch, +mplayer-1.0_pre5-r4.ebuild:
+ Added MPlayer ebuild with custom CFLAGS.
+
+*mplayer-1.0_pre5-r3 (20 Aug 2004)
+
+ 20 Aug 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r2.ebuild,
+ mplayer-1.0_pre5-r3.ebuild:
+ Fixed 3dnowex logic in -r3. Fixed some bad patch logic as well.
+
+ 18 Aug 2004; Chris White <chriswhite@gentoo.org> :
+ I added some xvmc related USE flags. Fixed matroska and live versions. Added a
+ doc USE flag in -r3. Fixed an mspt issue in pre4-r7. Anything else I can't
+ remember too.
+
+ 14 Aug 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r7.ebuild,
+ mplayer-1.0_pre5-r2.ebuild:
+ Fixed some live version issues. Thanks to Merlin for reporting.
+
+ 13 Aug 2004; Chris White <chriswhite@gentoo.org>
+ -files/amd64_fix_the_blue_love.patch, -files/default-skin.diff,
+ -files/mencoder-segfault.patch, -files/mplayer-0.90-divx.patch,
+ -files/mplayer-0.90-ppc-benh-2.patch, -files/mplayer-0.90_rc4-gtk2.patch,
+ -files/mplayer-1.0_pre3-alsa-gcc34.patch,
+ -files/mplayer-1.0_pre3-libavcodec-gcc34.patch,
+ -files/mplayer-1.0_pre3-libmatroska063.diff,
+ -files/mplayer-1.0_pre3-xmms.patch,
+ -files/mplayer-1.0_pre4-gcc34-mtune.patch, -files/noenca.patch,
+ -files/ppc750FX-fix.patch, -files/vuln01-fix.diff, -mplayer-0.92-r1.ebuild,
+ -mplayer-1.0_pre2-r1.ebuild, -mplayer-1.0_pre3-r3.ebuild,
+ -mplayer-1.0_pre3-r4.ebuild, -mplayer-1.0_pre3-r5.ebuild,
+ -mplayer-1.0_pre4-r1.ebuild, -mplayer-1.0_pre4-r2.ebuild,
+ -mplayer-1.0_pre4-r3.ebuild, -mplayer-1.0_pre4-r4.ebuild,
+ -mplayer-1.0_pre4.ebuild:
+ Cleaned out old unsupported mplayers and old patches.
+
+ 12 Aug 2004; Brian Harring <ferringb@gentoo.org> mplayer-1.0_pre4-r7.ebuild:
+ Corrected an issue with USE="gtk -png". bug #60136.
+
+ 13 Aug 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r2.ebuild:
+ Added tdfxfb support.
+
+ 11 Aug 2004; Anders Rune Jensen <arj@gentoo.org> mplayer-1.0_pre5-r2.ebuild,
+ files/mplayer-1.0_pre5-alsa-gui.patch:
+ Make the alsa patch work with dxr3. Fixes #59200. Caused by #58619.
+
+ 03 Aug 2004; Chris White <chriswhite@gentoo.org> :
+ Fixed digest issues.
+
+ 01 Aug 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r7.ebuild,
+ mplayer-1.0_pre5-r2.ebuild:
+ Should have been marked stable.
+
+ 31 Jul 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r2.ebuild:
+ Ensure proper LIVE version for live fix patch.
+
+ 31 Jul 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r7.ebuild,
+ mplayer-1.0_pre5-r2.ebuild:
+ Fixed some use logic with live and network.
+
+ 31 Jul 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r2.ebuild:
+ Took pre5-r2 down to unstable. See Bug #55456 for more information.
+
+ 30 Jul 2004; Bryan Østergaard <kloeri@gentoo.org>
+ mplayer-1.0_pre4-r7.ebuild:
+ Stable on alpha, see bug #55456.
+
+ 30 Jul 2004; Gustavo Zacarias <gustavoz@gentoo.org>
+ mplayer-1.0_pre5-r2.ebuild:
+ Stable on sparc wrt #55456
+
+ 31 Jul 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r2.ebuild:
+ Took pre5-r2 down to unstable. See Bug #55456 for more information.
+
+ 30 Jul 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5-r2.ebuild:
+ Added einfo about the network USE flag. This enables/disables streaming and is
+ not set by default in most users' make.conf/package.use. After recieving
+ duplicate issues on this, I've decided to add the einfo in.
+
+ 30 Jul 2004; Chris White <chriswhite@gentoo.org>
+ +files/mplayer-1.0_pre5-live.patch, mplayer-1.0_pre5-r2.ebuild:
+ Added fix for latest live-2004-07* for live USE flag. Fixes Bug #58807.
+
+ 29 Jul 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r7.ebuild,
+ mplayer-1.0_pre5-r2.ebuild:
+ Fixed live dependancy issue that was causing world update downgrades.
+
+ 29 Jul 2004; Chris White <chriswhite@gentoo.org> :
+ Re-added(?) myself as maintainer. Fixed alsa gui bug in #58619.
+
+ 27 Jul 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r7.ebuild,
+ mplayer-1.0_pre5-r2.ebuild:
+ Added -fPIC to kill register clobbering.
+
+ 27 Jul 2004; Daniel Ostrow <dostrow@gentoo.org> mplayer-1.0_pre4-r7.ebuild:
+ Stable on ppc.
+
+ 27 Jul 2004; Brian Harring <ferringb@gentoo.org> mplayer-1.0_pre4-r7.ebuild,
+ mplayer-1.0_pre5-r2.ebuild:
+ Corrected USE="v4l2" configuring.
+
+ 25 Jul 2004; Jeremy Huddleston <eradicator@gentoo.org>
+ mplayer-1.0_pre4-r7.ebuild, mplayer-1.0_pre5-r2.ebuild:
+ Changed amd64 stable to pre4 because of some problems in gmplayer. A patch to
+ pre5 will be put in soon.
+
+ 24 Jul 2004; Jeremy Huddleston <eradicator@gentoo.org>
+ mplayer-1.0_pre5-r2.ebuild:
+ Tested and marked stable for amd64 and x86.
+
+*mplayer-1.0_pre5-r2 mplayer-1.0_pre4-r7 (24 Jul 2004)
+
+ 24 Jul 2004; Brian Harring <ferringb@gentoo.org> mplayer-1.0_pre4-r6.ebuild,
+ mplayer-1.0_pre4-r7.ebuild, mplayer-1.0_pre5-r2.ebuild:
+ As it stands, these ebuilds should now be the targets for stabling. Mplayer
+ 1.0_pre4-r7 and 1.0_pre5-r2 are *not* to be fooled with, compilation fixes
+ are the only thing that should be added to these ebuilds- anything else
+ belongs in another unstable revbump. This fixes compilation issues w/
+ USE="-gtk png", USE="-gtk" and any of xv X xinerama,
+ USE="gif" (compilation failure), USE="-gif" (unconditionally linking in
+ libgif broken in previous fix for #58086), DOCS/TOOLS not being installed,
+ removed dep on X for gif (it was caused by said fix), USE="dvdread -dvd"
+ bring in dvdread and not using it, etc. Pretty large amount of fixes.
+ Versions 1.0_pre4-r6 and 1.0_pre5-r1 are removed from the tree, no user
+ should be using them (borked badly).
+ These ebuilds ought to end up as the targets for stabling for the gui
+ vulnerablity issues, thus they shouldn't be fooled w/ for anything but
+ needed fixes.
+
+ 24 Jul 2004; Jeremy Huddleston <eradicator@gentoo.org>
+ files/cachefill.patch:
+ Typo in the patch was in the conf file, not the source... fixing.
+
+ 24 Jul 2004; Chris White <chriswhite@gentoo.org> files/cachefill.patch,
+ +files/mplayer-1.0_pre5-r1-conf_locale.patch, mplayer-1.0_pre4-r6.ebuild,
+ mplayer-1.0_pre5-r1.ebuild:
+ Moved x11 support/xv driver to X USE flag. Fixed gif needing deps on X11.
+ Fixed small typo in the cachefill patch. Address issues mentioned in Bug
+ #58086. Also adds locale fix patch for Bug #58082.
+
+ 23 Jul 2004; Jeremy Huddleston <eradicator@gentoo.org>
+ mplayer-1.0_pre5-r1.ebuild:
+ Added kernel-2.6 fix on sparc (removes old workaround).
+
+ 23 Jul 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r6.ebuild,
+ mplayer-1.0_pre5-r1.ebuild:
+ Fixes some strange issue with the .20 live plugins being pulled in, despite
+ .27 being coded in. Re-Removed dvdread stuff.
+
+ 23 Jul 2004; Jeremy Huddleston <eradicator@gentoo.org>
+ mplayer-1.0_pre5-r1.ebuild:
+ Making USE=xvid work on all archs.
+
+ 23 Jul 2004; Brian Harring <ferringb@gentoo.org> mplayer-1.0_pre4-r6.ebuild,
+ mplayer-1.0_pre5-r1.ebuild:
+ Fixed broken deps for media-plugins/live and media-libs/libtheora for ia64
+
+ 23 Jul 2004; Brian Harring <ferringb@gentoo.org> mplayer-1.0_pre4-r6.ebuild,
+ mplayer-1.0_pre5-r1.ebuild, files/cachefill.patch:
+ Slipping eradicators cachefill patch in, bug #55936
+
+ 23 Jul 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r6.ebuild,
+ mplayer-1.0_pre5-r1.ebuild:
+ Fixed an ia64 dependancy error.
+
+*mplayer-1.0_pre5-r1 (23 Jul 2004)
+
+ 23 Jul 2004; Chris White <chriswhite@gentoo.org>
+ +files/mplayer-mythtv.patch, +files/mplayer-odml.patch,
+ -mplayer-1.0_pre4-r5.ebuild, +mplayer-1.0_pre4-r6.ebuild,
+ +mplayer-1.0_pre5-r1.ebuild, -mplayer-1.0_pre5.ebuild:
+ Cleaned up with the help of Mr_Bones_, solar, and ferringb. Added in mythtv
+ patch to fix bug #23544. Stable version for Bug #55456.
+
+ 23 Jul 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre4-r5.ebuild:
+ Helps if you commit the gui vulnerability patch when you're fixing a
+ vulnerability bug.
+
+ 23 Jul 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5.ebuild:
+ Fixed live dependancies. Fixes Bug #57963.
+
+ 23 Jul 2004; Chris White <chriswhite@gentoo.org>
+ -files/mga-kernel-2.6.patch, +files/mplayer-1.0_pre4-mga-kernel2.6.patch,
+ mplayer-1.0_pre4-r5.ebuild, mplayer-1.0_pre5.ebuild:
+ Cleaned up the ebuilds for pre4-r5 and pre5.
+
+ 19 Jul 2004; Travis Tilley <lv@gentoo.org> mplayer-1.0_pre4-r5.ebuild:
+ stable on amd64
+
+ 19 Jul 2004; Chris White <chriswhite@gentoo.org> +files/gui_vuln_code.patch,
+ +files/str_undefined.patch, +files/strl.c, mplayer-1.0_pre4-r5.ebuild:
+ Fixed mplayer pre4-r5 compiling issues with undefined str* references and
+ re-stabilized for gui vuln bug for amd64. Added fullscreen patch as well.
+
+ 16 Jul 2004; Bryan Østergaard <kloeri@gentoo.org> mplayer-1.0_pre5.ebuild:
+ Stable on alpha, see bug #55456.
+
+*mplayer-1.0_pre4-r5 (18 Jul 2004)
+
+ 18 Jul 2004; Chris White <chriswhite@gentoo.org>
+ +files/amd64_fix_the_blue_love.patch, +files/real_demux.patch,
+ mplayer-1.0_pre4-r4.ebuild, +mplayer-1.0_pre4-r5.ebuild:
+ Fixes Bug #53634 and Bug #55456 for amd64.
+
+ 15 Jul 2004; Jason Wever <weeve@gentoo.org> mplayer-1.0_pre5.ebuild:
+ Stable on sparc wrt bug #55456.
+
+ 16 Jul 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5.ebuild:
+ Weeve gave the heads up to mark this stable on sparc. Doing so.
+
+ 16 Jul 2004; Daniel Ostrow <dostrow@gentoo.org> mplayer-1.0_pre5.ebuild:
+ Stable on ppc.
+
+ 15 Jul 2004; Luca Barbato <lu_zero@gentoo.org>
+ +files/mplayer-1.0_pre5-yuv2rbg_kludge.patch, mplayer-1.0_pre5.ebuild:
+ Fixed the altivec scaler
+
+ 15 Jul 2004; Chris White <chriswhite@gentoo.org>
+ +files/mplayer-1.0_pre5-mga-kernel-2.6.patch, mplayer-1.0_pre5.ebuild:
+ Re-added the mga_vid.c patch to pre5. Thanks to Norman Yarvin for the heads
+ up. This fixes Bug #57138
+
+ 15 Jul 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5.ebuild:
+ Yay, more fun, they replaced the test ebuild which needed the noenca patch
+ with the final release.. (finally) so now I have to remove the patch :|
+
+ 15 Jul 2004; Chris White <chriswhite@gentoo.org> mplayer-1.0_pre5.ebuild:
+ Fixed the weird md5-ness with the tarballs
+
+*mplayer-1.0_pre5 (15 Jul 2004)
+
+ 15 Jul 2004; Chris White <chriswhite@gentoo.org> +files/noenca.patch,
+ +mplayer-1.0_pre5.ebuild:
+ Adding to the tree for stable marking on Bug #55456
+
+ 10 Jul 2004; Jason Wever <weeve@gentoo.org> mplayer-1.0_pre4.ebuild:
+ Stable on sparc.
+
+ 29 Jun 2004; Brian Harring <ferringb@gentoo.org> mplayer-1.0_pre4-r1.ebuild,
+ mplayer-1.0_pre4-r2.ebuild, mplayer-1.0_pre4-r3.ebuild,
+ mplayer-1.0_pre4-r4.ebuild, files/mplayer-1.0_pre4-gcc34-mtune.patch,
+ files/mplayer-1.0_pre4-help_mp-ro.h:
+ Closing out bugs #49669 (help/help_mp-ro.h having completely broken syntax),
+ gcc3.4 s:-mcpu:-mtune: (bug #49488).
+
+ 17 Jun 2004; Seemant Kulleen <seemant@gentoo.org>
+ mplayer-1.0_pre4-r4.ebuild:
+ added two variables: BLUV and SVGV to hold the version numbers of the tarballs
+ for BLUE and svga_helper, respectively. Now, version bumping those two things
+ shouldn't break mplayer's emerge processes.
+
+ 17 Jun 2004; Seemant Kulleen <seemant@gentoo.org>
+ mplayer-1.0_pre4-r4.ebuild:
+ change the occurrence of Blue-1.0 to Blue-1.4 to correspond to the recent
+ version bump
+
+ 17 Jun 2004; Luca Barbato <lu_zero@gentoo.org>
+ +files/mplayer-1.0_pre4-altivec-gcc34.patch, mplayer-1.0_pre4-r4.ebuild:
+ gcc-3.4 altivec fix
+
+ 16 Jun 2004; Martin Schlemmer <azarah@gentoo.org>
+ mplayer-1.0_pre4-r4.ebuild:
+ Update Blue skin to version 1.4
+
+ 09 Jun 2004; Aron Griffis <agriffis@gentoo.org> mplayer-0.92-r1.ebuild,
+ mplayer-1.0_pre2-r1.ebuild, mplayer-1.0_pre3-r3.ebuild,
+ mplayer-1.0_pre3-r4.ebuild, mplayer-1.0_pre3-r5.ebuild,
+ mplayer-1.0_pre4-r1.ebuild, mplayer-1.0_pre4-r2.ebuild,
+ mplayer-1.0_pre4-r3.ebuild, mplayer-1.0_pre4-r4.ebuild,
+ mplayer-1.0_pre4.ebuild:
+ Fix use invocation
+
+ 08 Jun 2004; Patrick Kursawe <phosphan@gentoo.org>
+ mplayer-1.0_pre4-r3.ebuild, mplayer-1.0_pre4-r4.ebuild:
+ Doing matrox related stuff only when matrox is in USE, see bug #53222
+
+ 02 Jun 2004; Brian Harring <ferringb@gentoo.org> mplayer-1.0_pre4-r1.ebuild,
+ mplayer-1.0_pre4-r2.ebuild, mplayer-1.0_pre4-r3.ebuild,
+ mplayer-1.0_pre4-r4.ebuild, mplayer-1.0_pre4.ebuild:
+ Missing IUSE for nas, nls. Added live use flag to pre4, removed the inline
+ autodetect of live, making it a use flag controlled dep. moved all IUSE
+ statements below inherit, where they should stay. Closed bugs #49481 and
+ #36815.
+
+ 01 Jun 2004; Travis Tilley <lv@gentoo.org> mplayer-1.0_pre4-r4.ebuild:
+ stable on amd64
+
+ 01 Jun 2004; Brian Harring <ferringb@gentoo.org> mplayer-1.0_pre4-r1.ebuild,
+ mplayer-1.0_pre4-r2.ebuild, mplayer-1.0_pre4-r3.ebuild,
+ mplayer-1.0_pre4-r4.ebuild, mplayer-1.0_pre4.ebuild:
+ Added necessary --internal-(matroska|faad) for matroska (bug #50533) and mpeg.
+ MPlayer uses external libs when those flags are specified, otherwise,
+ internal. Also fixed missing IUSE flags. Fixed use dvb syntax error in pre4-r2.
+
+ 01 Jun 2004; Brian Harring <ferringb@gentoo.org> mplayer-1.0_pre4-r4.ebuild,
+ mplayer-1.0_pre4.ebuild:
+ Added use flags for libcaca since mplayer autodetects it already (bug #49369),
+ and missing xinerama IUSE (bug #51509)
+
+ 28 May 2004; Guy Martin <gmsoft@gentoo.org> mplayer-1.0_pre4-r4.ebuild:
+ Added ~hppa to KEYWORDS. Little build fix.
+
+*mplayer-1.0_pre4-r4 (28 May 2004)
+
+ 28 May 2004; Luca Barbato <lu_zero@gentoo.org> +mplayer-1.0_pre4-r4.ebuild:
+ Upstream requested change to the ebuild
+
+ 28 May 2004; Patrick Kursawe <phosphan@gentoo.org>
+ mplayer-1.0_pre4-r3.ebuild:
+ The sandbox fixes were fine for 2.6.6, but failed with 2.6.5. Fixed that, see
+ bug #40616 again.
+
+ 27 May 2004; Daniel Ostrow <dostrow@gentoo.org> mplayer-1.0_pre4-r3.ebuild:
+ Stable on ppc.
+
+ 27 May 2004; Jon Portnoy <avenj@gentoo.org> mplayer-1.0_pre4-r3.ebuild :
+ Stable on AMD64
+
+ 27 May 2004; Brian Harring <ferringb@gentoo.org> mplayer-1.0_pre4-r1.ebuild,
+ mplayer-1.0_pre4-r2.ebuild, mplayer-1.0_pre4-r3.ebuild,
+ mplayer-1.0_pre4.ebuild:
+ Adding xvid, divx4linux use flags (bug #30242), bidi (bug #41482), and mad
+ (bug #32606). Bit of cleanup of myconf, moved IUSE after inherit for
+ 1.0_pre4-r3 (portage 2.0.51_pre9 doesn't play nice w/ IUSE above inherit, see
+ bug #52160).
+
+*mplayer-1.0_pre4-r3 (26 May 2004)
+
+ 26 May 2004; Patrick Kursawe <phosphan@gentoo.org>
+ mplayer-1.0_pre4-r3.ebuild:
+ Sandbox problems (like bug #52058) should be history now.
+ Using kmod.eclass instead of check-kernel now (bug #51903)
+
+*mplayer-1.0_pre4-r2 (19 May 2004)
+
+ 19 May 2004; Patrick Kursawe <phosphan@gentoo.org>
+ mplayer-1.0_pre4-r2.ebuild, files/mga-kernel-2.6.patch:
+ Fixing bug #40616 (mga driver), little cleanups for the patch section.
+
+ 12 May 2004; Alexander Gabert <pappy@gentoo.org> mplayer-1.0_pre3-r5.ebuild,
+ mplayer-1.0_pre4-r1.ebuild, mplayer-1.0_pre4.ebuild:
+ added new hardened PIE SSP switches
+
+ 12 May 2004; Alexander Gabert <pappy@gentoo.org> mplayer-0.92-r1.ebuild,
+ mplayer-1.0_pre2-r1.ebuild, mplayer-1.0_pre3-r3.ebuild,
+ mplayer-1.0_pre3-r4.ebuild:
+ removed hardened-gcc logic, added filter-flags fPIC logic
+
+ 02 May 2004; Jason Wever <weeve@gentoo.org> mplayer-1.0_pre4-r1.ebuild:
+ Changed -sparc keyword back to ~sparc.
+
+ 30 Apr 2004; Bryan Østergaard <kloeri@gentoo.org>
+ mplayer-1.0_pre4-r1.ebuild:
+ Stable on alpha.
+
+*mplayer-1.0_pre4-r1 (30 Apr 2004)
+
+ 30 Apr 2004; Martin Holzer <mholzer@gentoo.org> mplayer-1.0_pre4-r1.ebuild:
+ live is now a local use flag.
+
+ 30 Apr 2004; Martin Holzer <mholzer@gentoo.org> mplayer-1.0_pre4.ebuild:
+ fixing live depend. closes 49481
+
+ 29 Apr 2004; Brandon Hale <tseng@gentoo.org> mplayer-1.0_pre4.ebuild:
+ Stable on x86 for multiple vulnerabilities, bug #49387.
+
+*mplayer-1.0_pre4 (28 Apr 2004)
+
+ 28 Apr 2004; Martin Holzer <mholzer@gentoo.org> mplayer-1.0_pre4.ebuild:
+ Version bumped.
+
+ 28 Apr 2004; Travis Tilley <lv@gentoo.org>
+ +files/mplayer-1.0_pre3-alsa-gcc34.patch,
+ +files/mplayer-1.0_pre3-libavcodec-gcc34.patch, mplayer-1.0_pre3-r5.ebuild:
+ added a fix for compiling with gcc 3.4. yaaay! =)
+
+ 19 Apr 2004; Chris Gianelloni <wolf31o2@gentoo.org> mplayer-0.92-r1.ebuild,
+ mplayer-1.0_pre2-r1.ebuild, mplayer-1.0_pre3-r3.ebuild,
+ mplayer-1.0_pre3-r4.ebuild, mplayer-1.0_pre3-r5.ebuild:
+ Removed broken gtk2 patch from all versions still in portage and closing bug
+ #15786.
+
+ 13 Apr 2004; Scott W Taylor <swtaylor@gentoo.org>
+ mplayer-1.0_pre3-r5.ebuild:
+ update -fPIC handling for post-hardened-gcc
+
+ 08 Apr 2004; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre3-r5.ebuild:
+ Added useflags for v4l and v4l2
+
+ 06 Apr 2004; Brandon Hale <tseng@gentoo.org> mplayer-1.0_pre3-r5.ebuild:
+ Update -fPIC filtering magic for post hardened-gcc.
+
+ 04 Apr 2004; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre3-r5.ebuild,
+ files/ppc750FX-fix.patch:
+ Minor fix to extend the G3 cpu supported, thanks to Simon Strandman
+ <simon.strandman@telia.com>, bug #44276
+
+ 31 Mar 2004; Martin Holzer <mholzer@gentoo.org> mplayer-1.0_pre3-r5.ebuild:
+ adding ipv6 configure. closes 42940
+
+*mplayer-1.0_pre3-r3 (31 Mar 2004)
+*mplayer-1.0_pre3-r5 (31 Mar 2004)
+*mplayer-1.0_pre3-r4 (31 Mar 2004)
+*mplayer-1.0_pre2-r1 (31 Mar 2004)
+*mplayer-0.92-r1 (31 Mar 2004)
+
+ 31 Mar 2004; Patrick Kursawe <phosphan@gentoo.org> mplayer-0.92-r1.ebuild,
+ mplayer-0.92.ebuild, mplayer-1.0_pre2-r1.ebuild, mplayer-1.0_pre2.ebuild,
+ mplayer-1.0_pre3-r1.ebuild, mplayer-1.0_pre3-r2.ebuild,
+ mplayer-1.0_pre3-r3.ebuild, mplayer-1.0_pre3-r4.ebuild,
+ mplayer-1.0_pre3-r5.ebuild, mplayer-1.0_pre3.ebuild, files/vuln02-fix.diff:
+ Revision bumped all currently available ebuilds and added a patch for a
+ security problem, see bug #46246.
+ Because of different keywordings for 1.0_pre3 they were bumped like follows:
+ 1.0_pre3 -> 1.0_pre3-r3
+ 1.0_pre3-r1 -> 1.0_pre3-r4
+ 1.0_pre3-r2 -> 1.0_pre3-r5
+
+ 29 Mar 2004; Donnie Berkholz <spyderous@gentoo.org>; mplayer-0.92.ebuild,
+ mplayer-1.0_pre2.ebuild, mplayer-1.0_pre3-r1.ebuild,
+ mplayer-1.0_pre3-r2.ebuild, mplayer-1.0_pre3.ebuild:
+ Change x11-base/xfree dependency to virtual/x11.
+
+ 23 Mar 2004; Martin Holzer <mholzer@gentoo.org> mplayer-1.0_pre3-r2.ebuild,
+ files/mplayer-1.0_pre3-xmms.patch:
+ added patch to disable xmms. closes 45356
+
+ 21 Mar 2004; Jason Wever <weeve@gentoo.org> mplayer-1.0_pre3-r2.ebuild:
+ Added ~sparc keyword.
+
+ 21 Mar 2004; Jason Wever <weeve@gentoo.org> mplayer-1.0_pre3-r2.ebuild:
+ Marked -sparc until libtheora builds on sparc.
+
+*mplayer-1.0_pre3-r2 (21 Mar 2004)
+
+ 21 Mar 2004; Martin Holzer <mholzer@gentoo.org> mplayer-1.0_pre3-r2.ebuild:
+ adding libtheora support.
+
+ 18 Mar 2004; Martin Holzer <mholzer@gentoo.org> mplayer-1.0_pre3-r1.ebuild,
+ files/mplayer-1.0_pre3-libmatroska063.diff:
+ adding patch to compile with latest libmatroska
+
+ 16 Mar 2004; Stephen P. Becker <geoman@gentoo.org> mplayer-1.0_pre3.ebuild:
+ Added ~mips keyword.
+
+ 15 Mar 2004; Jason Wever <weeve@gentoo.org> mplayer-0.92.ebuild:
+ Marked stable on sparc.
+
+*mplayer-1.0_pre3-r1 (11 Mar 2004)
+
+ 11 Mar 2004; <kanaka@gentoo.org> mplayer-1.0_pre3-r1.ebuild:
+ Updated to NOT install libpostproc libraries (bug 43640). Now provided by
+ >=ffmpeg-0.4.8.20040222.
+
+ 27 Feb 2004; Jason Wever <weeve@gentoo.org> mplayer-1.0_pre3.ebuild:
+ Nothing but ~sparc.
+
+ 26 Feb 2004; Guy Martin <gmsoft@gentoo.org> :
+ Keyworded ~hppa.
+
+ 16 Jan 2004; Bartosch Pixa <darkspecter@gentoo.org> mplayer-1.0_pre3.ebuild:
+ set ppc in keywords
+
+ 25 Dec 2003; Seemant Kulleen <seemant@gentoo.org> mplayer-0.92.ebuild,
+ mplayer-1.0_pre1-r1.ebuild, mplayer-1.0_pre2.ebuild,
+ mplayer-1.0_pre3.ebuild:
+ changed SRC_URI to use mirror://mplayer instead
+
+ 14 Dec 2003; Martin Holzer <mholzer@gentoo.org> mplayer-1.0_pre3.ebuild:
+ Changing matroska version. Closes #35787
+
+ 12 Dec 2003; Seemant Kulleen <seemant@gentoo.org> mplayer-1.0_pre3.ebuild:
+ --disable-css is a deprecated configure option now. Closes bug #35644 by
+ butters@opengames.net and its duplicates
+
+*mplayer-1.0_pre3 (11 Dec 2003)
+
+ 20 Dec 2003; Guy Martin <gmsoft@gentoo.org> mplayer-1.0_pre3.ebuild :
+ Fixed detection of hppa boxes.
+
+ 11 Dec 2003; Seemant Kulleen <seemant@gentoo.org> mplayer-1.0_pre3.ebuild,
+ files/mplayer-1.0-gtk2.patch:
+ version bump to newest release -- includes updated gtk2 patch
+
+ 04 Dec 2003; Seemant Kulleen <seemant@gentoo.org> mplayer-0.92.ebuild,
+ mplayer-1.0_pre1-r1.ebuild, mplayer-1.0_pre2.ebuild:
+ fix the gtk/gtk2 USE flag syntax, closing bug #34567 by Spider
+ <spider@gentoo.org>
+
+ 16 Nov 2003; Brad House <brad_mssw@gentoo.org> mplayer-1.0_pre2.ebuild:
+ mark stable on amd64
+
+ 30 Oct 2003; Martin Holzer <mholzer@gentoo.org> mplayer-1.0_pre2.ebuild:
+ Adding joystick support. Closes #31470.
+
+ 26 Oct 2003; Luca Barbato <lu_zero@gentoo.org> mplayer-1.0_pre2.ebuild:
+ Added debug useflag, minor fixes. Closes #31978 and #31996.
+ thanks to Andrew Kirilenko <icedank@gmx.net> and Juri Haberland
+ <juri@koschikode.com>.
+
+ 20 Oct 2003; Martin Holzer <mholzer@gentoo.org> mplayer-1.0_pre1-r1.ebuild,
+ mplayer-1.0_pre2.ebuild:
+ added matroska support. Closes #28636.
+
+ 14 Oct 2003; Martin Holzer <mholzer@gentoo.org> mplayer-0.92.ebuild,
+ mplayer-1.0_pre1-r1.ebuild, mplayer-1.0_pre2.ebuild:
+ RDEPEND error fixed. Closes #30624.
+
+ 14 Oct 2003; Martin Holzer <mholzer@gentoo.org> mplayer-0.92.ebuild,
+ mplayer-1.0_pre1-r1.ebuild, mplayer-1.0_pre2.ebuild:
+ adding lirc IUSE flag. Closes #31031.
+
+ 11 Oct 2003; Martin Holzer <mholzer@gentoo.org> mplayer-0.92.ebuild,
+ mplayer-1.0_pre1-r1.ebuild, mplayer-1.0_pre2.ebuild:
+ fixed Doc permissions. Closes #30724.
+
+ 09 Oct 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.92.ebuild,
+ mplayer-1.0_pre1-r1.ebuild, mplayer-1.0_pre2.ebuild:
+ Add a note about us using MPlayer set C[XX]FLAGS to avoid confusion.
+
+ 09 Oct 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.92.ebuild,
+ mplayer-1.0_pre1-r1.ebuild, mplayer-1.0_pre2.ebuild:
+ Get fonts to install properly again, fixing bug #30213.
+
+ 08 Oct 2003; Luca Barbato<lu_zero@gentoo.org> mplayer-1.0_pre2.ebuild:
+ ppc related fix.
+
+*mplayer-1.0_pre2 (07 Oct 2003)
+
+ 07 Oct 2003; Martin Holzer <mholzer@gentoo.org> mplayer-1.0_pre2.ebuild:
+ Version bumped. Closes #30415.
+
+ 06 Oct 2003; Martin Holzer <mholzer@gentoo.org> mplayer-0.92.ebuild,
+ mplayer-1.0_pre1-r1.ebuild:
+ Adding aalib configure strings. Closes #21984.
+
+ 29 Sep 2003; Martin Holzer <mholzer@gentoo.org> :
+ Fixing digest.
+
+*mplayer-1.0_pre1-r1 (27 Sep 2003)
+
+ 27 Sep 2003; <solar@gentoo.org> mplayer-1.0_pre1-r1.ebuild,
+ files/vuln01-fix.diff:
+ security fix for devel branch
+
+*mplayer-0.92 (28 Sep 2003)
+
+ 28 Sep 2003; Martin Holzer <mholzer@gentoo.org> mplayer-0.92.ebuild:
+ Version bumped. Closes a security Problem.
+
+ 23 Sep 2003; Martin Holzer <mholzer@gentoo.org> :
+ digest update. closes #29363
+
+ 12 Sep 2003; heinrich Wendel <lanius@gentoo.org> mplayer-1.0_pre1.ebuild,
+ mplayer-0.91.ebuild:
+ fixed samba dep to version 2.2.8a
+
+ 07 Sep 2003; Alexander Gabert <pappy@gentoo.org> mplayer-0.91.ebuild:
+ added hardened-gcc excludes
+
+ 06 Sep 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-1.0_pre1.ebuild:
+ Cleanup libpostproc stuff a bit. Last time I checked, we should not need to
+ install the static version of the library.
+
+ 04 Sep 2003; Heinrich Wendel <lanius@gentoo.org> mplayer-0.90-r2.ebuild,
+ mplayer-0.90-r5.ebuild, mplayer-0.90_rc4.ebuild, mplayer-0.91.ebuild,
+ mplayer-1.0_pre1.ebuild, files/mplayer-0.90-fix-version.patch:
+ - removed old ebuilds
+ - fixed samba bug #25912
+ - fixed fs bug #12751
+ - marked 0.91 stable on x86 and ppc
+
+*mplayer-1.0_pre1 (04 Sep 2003)
+
+ 04 Sep 2003; Martin Holzer <mholzer@gentoo.org> mplayer-1.0_pre1.ebuild:
+ Version bumped.
+
+ 24 Aug 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90-r2.ebuild,
+ mplayer-0.90-r5.ebuild, mplayer-0.90_rc4.ebuild, mplayer-0.91.ebuild,
+ files/mencoder-segfault.patch:
+ Fix mencoder segfault when used improperly, bug #23611
+
+*mplayer-0.91 (20 Aug 2003)
+
+ 20 Aug 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.91.ebuild:
+ New version.
+
+*mplayer-0.90-r5 (10 Aug 2003)
+
+ 10 Aug 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90-r5.ebuild:
+ Some cleanups - do not try to autodetect video/audio settings, as MPlayer does
+ it by itself these days. Change a few things as suggested by Gabucino
+ (--enable-3dfx is broken, and --enable-dynamic-plugins could have issues).
+ Eventually add the new default Skin of MPlayer (Blue).
+
+ 04 Aug 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90-r4.ebuild,
+ files/mplayer-0.90-ppc-benh-2.patch:
+ Fix ppc-benh.patch to play nicely with coreutils-fixup.patch, bug #25833
+
+*mplayer-0.90-r4 (03 Aug 2003)
+
+ 03 Aug 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90-r4.ebuild,
+ files/mplayer-0.90-coreutils-fixup.patch:
+ Remove building of svgalib kernel module. Should fix bug #25062.
+
+ 18 Jul 2003; Martin Holzer <mholzer@gentoo.org> mplayer-0.90-r3.ebuild:
+ Final fix.
+
+ 16 Jul 2003; Luca Barbato<lu_zero@gentoo.org> mplayer-0.90-r2.ebuild,
+ mplayer-0.90-r3.ebuild:
+ Make it install every documentation file. Closes #20662.
+
+ 16 Jul 2003; Martin Holzer <mholzer@gentoo.org> mplayer-0.90-r2.ebuild,
+ mplayer-0.90-r3.ebuild, mplayer-0.90_rc4.ebuild, mplayer-0.90_rc5.ebuild:
+ Added IUSE flag for xmms. Closes #20090.
+
+ 16 Jul 2003; Martin Holzer <mholzer@gentoo.org> mplayer-0.90-r2.ebuild:
+ Marked x86 stable.
+
+*mplayer-0.90-r3 (16 Jul 2003)
+
+ 16 Jul 2003; Martin Holzer <mholzer@gentoo.org> mplayer-0.90-r3.ebuild:
+ Added vidix support. Submitted by phoen][x <fisi.tilman.klar@gmx.de> in #20114.
+
+*mplayer-0.90-r2 (01 Jul 2003)
+
+ 01 Jul 2003; Martin Holzer <mholzer@gentoo.org> mplayer-0.90-r2.ebuild,
+ files/mplayer-0.90-divx.patch:
+ Adding logic to detect newer DivX Api and patching. Closes #23795.
+
+ 11 Jun 2003; Jason Wever <weeve@gentoo.org> mplayer-0.90-r1.ebuild:
+ Added ~sparc to keywords.
+
+*mplayer-0.90-r1 (27 Apr 2003)
+
+ 27 Apr 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90-r1.ebulid,
+ mplayer-0.90-fix-version.patch :
+ - Fix version (still displayed as rc5), bug #19691.
+ - Change DEPEND to only depend and enable faad2 support if 'mpeg' in USE,
+ closing bug #19119.
+ - Add SMB (Samba) support, closing bug #16395.
+
+*mplayer-0.90 (09 Apr 2003)
+
+ 20 Apr 2003; Seemant Kulleen <seemant@gentoo.org> mplayer-0.90.ebuild :
+ Added faad2 and enabling faad in econf -- satisies many requests to be able to
+ play the Matrix trailers.
+
+ 16 Apr 2003; Lars Weiler <pylon@gentoo.org> mplayer-0.90.ebuild,
+ files/mplayer-0.90-ppc-benh.patch:
+ No big change.
+ Added the mentioned patch in bug #18511 for the right order of the
+ ppc-processor-switch and some more ppc-related einfo-lines about the altivec
+ issue with DivX.
+
+ 09 Mar 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90.ebuild :
+ New version:
+ - Add 'dvb' use flag (bug #13809), thanks to Juri Haberland <juri@koschikode.com>
+ - Fix MPlayer to detect/use altivec on benh kernels (bug #18511), thanks to
+ Stephan van Maris <svmaris@e-village.nl> and Lars Weiler <pylon@gentoo.org>.
+ - Remove dvdnav support as its broken anyhow. According to lists, no effort
+ will be made soon to get it fixed.
+ This should also close bug #18879.
+
+ 30 Mar 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_rc5.ebuild :
+ Mark stable for x86. Fix bug #18211, thanks to Philippe Lafoucri?re
+ <lafou@wanadoo.fr>.
+
+*mplayer-0.90_rc5 (18 Mar 2003)
+
+ 16 Apr 2003; Martin Holzer <mholzer@gentoo.org> mplayer-0.90_rc5.ebuild:
+ Forcing to use old libdvdnav.
+
+ 18 Mar 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_rc5.ebuild :
+ New version.
+
+ 13 mar 2003; Olivier Reisch <doctomoe@gentoo.org> mplayer-0.90_rc4.ebuild :
+ Marked ppc stable
+
+*mplayer-0.90_rc4 (16 Feb 2003)
+
+ 16 Apr 2003; Martin Holzer <mholzer@gentoo.org> mplayer-0.90_rc4.ebuild:
+ Forcing to use old libdvdnav.
+
+ 06 March 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_rc4.ebuild :
+
+ - Fix esound not disabled if 'esd' not in USE, bug #16758.
+ - Remove --enable-shared-pp from ./configure, as it breaks mplayer with
+ gcc-2.95.3,bug #14479.
+ - Mark stable for x86.
+
+ 16 Feb 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_rc4.ebuild :
+
+ Update version.
+ Add LIVE.COM support, thanks to J Robert Ray <jrray@gentoo.org>, bug #14766.
+
+ 02 Feb 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_*.ebuild :
+
+ Fix SRC_URI for fonts, closing bug #14770.
+
+ 21 Jan 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_rc3.ebuild :
+
+ Add --with-x11incdir=/usr/X11R6/include as a temporary fix for bug #14311.
+
+*mplayer-0.90_rc3 (20 Jan 2003)
+
+ 20 Jan 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_rc3.ebuild :
+
+ New version.
+
+ 19 Jan 2003; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_rc2.ebuild :
+
+ Only enable devfs support if /dev/.devfsd exists, bug #13613.
+
+ 07 Dec 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_rc2.ebuild :
+
+ Add lirc support, thanks to Jarkko Haapalainen <johaapa@student.oulu.fi>,
+ bug #12244. Mark stable for x86, and fix to depend on xfree-4.2.1-r2, fixing
+ problems with gtk2 support and freetype.
+
+*mplayer-0.90_rc2 (26 Dec 2002)
+
+ 26 Dec 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_rc2.ebuild :
+
+ New version.
+
+*mplayer-0.90_rc1-r1 (13 Dec 2002)
+
+ 13 Dec 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_rc1-r1.ebuild :
+
+ Fix the xvid bork. Add gtk2 support :D
+
+*mplayer-0.90_rc1 (8 Dec 2002)
+
+ 08 Dec 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_rc1.ebuild :
+
+ New version, closing bug #11775.
+
+ 01 Dec 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_pre10.ebuild :
+
+ Mark as stable.
+
+ 24 Nov 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_pre10.ebuild :
+
+ Add arts support, closing bug #11122.
+
+*mplayer-0.90_pre10 (11 Nov 2002)
+
+ 11 Nov 2002; Martin Schlemmer <azarah@gentoo.org> :
+
+ Nev version.
+
+ 5 Nov 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_pre9.ebuild :
+
+ Add realplayer support, closing bug #6286.
+
+*mplayer-0.90_pre9 (27 Oct 2002)
+
+ 27 Oct 2002; Martin Schlemmer <azarah@gentoo.org> :
+
+ New version.
+
+*mplayer-0.90_pre8-r1 (12 Oct 2002)
+
+ 12 Oct 2002; Martin Schlemmer <azarah@gentoo.org> :
+
+ Add patch for build failure without oss if "TV" is enabled by
+ configure. Thanks goes to Chad Netzer <chad.netzer@stanfordalumni.org>.
+ This closes bug #8604.
+
+*mplayer-0.90_pre8 (26 Sep 2002)
+
+ 26 Sep 2002; Kevyn Shortell<trance@gentoo.org> mplayer-0.90_pre8.ebuild :
+ PPC keyword added, tested on ibook 300mhz, worked well.
+
+*mplayer-0.90_pre8 (19 Sep 2002)
+
+ 19 Sep 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_pre8.ebuild :
+ New bugfix release.
+
+*mplayer-0.90_pre7 (16 Sep 2002)
+
+ 16 Sep 2002; Olivier Reisch <doctomoe@gentoo.org> mplayer-0.90_pre7.ebuild :
+ Removed ppc keyword. Audio does not work at all on PPC.
+
+ 15 Sep 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_pre7.ebuild :
+ Update version.
+
+*mplayer-0.90_pre6-r3 (12 Aug 2002)
+
+ 16 Sep 2002; Olivier Reisch <doctomoe@gentoo.org> mplayer-0.90_pre6-r3.ebuild :
+ Removed ppc keyword. Audio does not work at all on PPC.
+
+ Sep 11 2002; Mark Guertin <gerk@gentoo.org> mplayer-0.90_pre6-63.ebuild :
+ Adjusted divx4linux as x86 only dep (it supplies x86 binary libs), goes along
+ with bug #7796
+
+ Sep 10 2002, Mark Guertin <gerk@gentoo.org> :
+ adjusted nasm and win32codes to use x86 USE flags (they don't work on
+ anything except x86)
+
+ 12 Aug 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_pre6-r3.ebuild :
+
+ Add patch to support libdvdnav-0.1.3.
+
+ Fix screwup with new patch.
+
+*mplayer-0.90_pre6-r2 (07 Aug 2002)
+
+ 07 Aug 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_pre6-r2.ebuild :
+
+ Update DEPEND to block libdvdnav-0.1.3. Change "emake" to "make", as
+ 'make -j' fails in some cases.
+
+*mplayer-0.90_pre6-r1 (07 Aug 2002)
+
+ 07 Aug 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_pre6-r1.ebuild :
+
+ Fix compile problems if "dvd" not in USE. Added two patches for this:
+
+ mplayer-0.90_pre6-no-dvd.patch
+ mplayer-0.90_pre6-stream-include.patch
+
+*mplayer-0.90_pre6 (06 Aug 2002)
+
+ 06 Aug 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_pre6.ebuild :
+
+ New version. Patch vidix's Makefile not to fail if it cannot install
+ any drivers. This should resolve bug #5246.
+
+*mplayer-0.90_pre5-r1 (13 Jun 2002)
+
+ 13 Jun 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_pre5-r1.ebuild :
+
+ Fix missing subtitles for region 4 DVD's, bug #3679, thanks to report
+ from Bernardo S. A. Silva.
+
+*mplayer-0.90_pre5 (10 Jun 2002)
+
+ 10 Jun 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_pre5.ebuild :
+
+ Version update with a few fixes (vidix install location, #include errors,
+ etc).
+
+*mplayer-0.90_pre4 (21 May 2002)
+
+ 21 May 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_pre4.ebuild :
+
+ Add new version. Resolves bug #2891. This version seems to fix many
+ of the bugs with previous 0.90_pre versions.
+
+*mplayer-0.90_pre3-r1 (5 May 2002)
+
+ 8 May 2002; Jon Nelson <jnelson@gentoo.org> mplayer-0.90_pre3-r1.ebuild :
+
+ Use new check_KV from portage 1.9.10
+
+ 5 May 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_pre3-r1.ebuild :
+
+ Fix some compile problems for Gui, thanks to Gwenn Gueguen.
+
+*mplayer-0.90_pre3 (5 May 2002)
+
+*mplayer-0.90_pre2-r2 (5 May 2002)
+
+ 5 May 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_pre2-r2.ebuild :
+
+ Resolve bug #2386 (hopefully); also fix a vidix problem I and other users
+ on gentoo-user experienced.
+
+*mplayer-0.90_pre2-r1 (1 May 2002)
+
+ 1 May 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_pre2-r1.ebuild :
+
+ Resolve bug #2284.
+
+*mplayer-0.90_pre2 (30 Apr 2002)
+
+ 26 Apr 2002; William McArthur <sandymac@gentoo.org> mplayer-0.90_pre1.ebuild :
+
+ Commented out a matrox specific patch that seems to be aready in the upstream
+ package.
+
+*mplayer-0.90_pre1 (23 Apr 2002)
+
+*mplayer-0.60-r6 (22 Apr 2002)
+
+ 22 Apr 2002; Seemant Kulleen <seemant@gentoo.org> mplayer-0.60-r6.ebuild :
+
+ Removed directfb flag for now, until next mplayer release. Also, added
+ --disable-runtime-cpudetection for increased performance. First one thanks
+ to naz in #gentoo, second one thanks to
+ dwright@beached.dyndns.org (Darrell Wright) in bug #1967
+
+
+ 18 Apr 2002; Seemant Kulleen <seemant@gentoo.org>
+ fixed a small typo I made in the matrox section
+
+ 17 Apr 2002; Seemant Kulleen <seemant@gentoo.org> mplayer-0.60-r6.ebuild
+ files/digest-mplayer-0.60-r6 :
+
+ Removed -- the old source tarball will be mirrored on ibilio instead.
+
+*mplayer-0.60-r6 (17 Apr 2002)
+
+ 17 Apr 2002; Seemant Kulleen <seemant@gentoo.org> mplayer-0.60-r6.ebuild
+ files/digest-mplayer-0.60-r6 :
+
+ This is an upgrade in a way, because it is now fetching the cvs snapshot
+ from the site. The actual 0.60 sources have been removed from the
+ SRC_URI, and they are replaced with a weekly snapshot. This is fine
+ because it offers much better performance than the old "stable" version.
+
+*mplayer-0.60-r5 (14 Apr 2002)
+
+ 14 Apr 2002; Seemant Kulleen <seemant@gentoo.org> mplayer-0.60-r5.ebuild :
+
+ Cleaned up some of the USE flag checking, and made it more consistent, so
+ that there are no if then fi constructs for USE flags.
+
+*mplayer-0.60-r5 (12 Apr 2002)
+
+ 14 Apr 2002; M.Schlemmer <azarah@gentoo.org> mplayer-0.60-r5 :
+
+ Remove the png USE flag, as the gui depends on libpng. Take --enable-dvdread
+ out of the main ./configure part, as its now done with the dvd use flag.
+ Clean the mmx and X USE flag selection parts up.
+
+*mplayer-0.60-r4 (12 Apr 2002)
+
+ 12 Apr 2002; Seemant Kulleen <seemant@gentoo.org> mplayer-0.60-r4.ebuild :
+
+ Added png USE flag and removed css USE flag for dvd flag instead. And,
+ compile against newest libpng
+
+*mplayer-0.60-r3 (28 Mar 2002)
+
+ 28 Mar 2002; Seemant Kulleen <seemant@gentoo.org> mplayer-0.60-r3.ebuild :
+
+ ogg and vorbis USE flags combined to have oggvorbis USE flag instead.
+
+*mplayer-0.60-r3 (3 March 2002)
+
+ 3 March 2002; M.Schlemmer <azarah@gentoo.org> mplayer-0.60-r3.ebuild :
+
+ Add the DXR3 patch. Update the DEPEND to include libpng if gtk is in USE.
+
+ 25 Feb 2002; M.Schlemmer <azarah@gentoo.org> mplayer-0.60-r2.ebuild :
+
+ Fix the 'fbcon' USE to actually enable fbdev support.
+
+ 17 Feb 2002; M.Schlemmer <azarah@gentoo.org> mplayer-0.60-r2.ebuild :
+
+ Make DVD support default. Changed the USE flag for DVD decription from
+ 'decss' to 'css'. Added 3DFX support with the '3dfx' use variable. Fixed
+ a problem where if 'sse' or '3dnow' was in USE, but now MMX, sound would be
+ distorted .. this should resolve bug #536.
+
+*mplayer-0.60-r1 (1 Feb 2002)
+
+ 1 Feb 2002; G.Bevin <gbevin@gentoo.org> ChangeLog :
+
+ Added initial ChangeLog which should be updated whenever the package is
+ updated in any way. This changelog is targetted to users. This means that the
+ comments should well explained and written in clean English. The details about
+ writing correct changelogs are explained in the skel.ChangeLog file which you
+ can find in the root directory of the portage repository.
diff --git a/media-sound/mplayer/Manifest b/media-sound/mplayer/Manifest
new file mode 100644
index 0000000..785f378
--- /dev/null
+++ b/media-sound/mplayer/Manifest
@@ -0,0 +1,23 @@
+AUX dump_ffmpeg.sh 2489 SHA256 c714e2faa2128f1c94ac046ff106a5f845347d18e1099f6aeab90aff2326e98e SHA512 23a7ead05851f8ce6b9c94326072dd4aff62ee79addffaf67ffd9048895e3721ee83f1e8dd62ea15f6b93bbc963455dcc97cfe0150bc64b9b40e018739a5fa7a WHIRLPOOL 94c8a92c697834e43917e5cbba3880ecada05178ef123a4b2da6998e4f47ca204363451122443aab1f186618d2c43cecad39d94aac35989968d07609ed4900e5
+AUX extra/mplayer-coreavc-1.1.patch 21888 SHA256 e17cebe07d2954adf58f319988d641ee1b46f62dd2e144d7457320a4d07b731b SHA512 2bb107cf4a1a1c2bbd2dfd4fb5aa05b75ab645cc27e23827031987de8a72834978c0a57263a11549f87d4c10cbd0f901fc7148702609be55dfb37a027c05ed1f WHIRLPOOL 1c979843b6ee74ca6ac519ecd8946ec3aeeb4cc9e4057598b6aebbea3a602b0dc466bcd806060fff0a68fad882a944a0c6727782177cc1280689acb8dd7c1433
+AUX extra/mplayer-orderedmkv-1.1-need_fixing.patch 26781 SHA256 dd14ecee3bdba2e3ab674ef9449faf381d079074a6b5ab33f01c699879413457 SHA512 243f64f1d7aa3376b8b30a6456810d8e387cba5e92def6068ff5a80ac501689934408a652380c376fe80ed823f9b2d2e5f0f66e08e98c76763fcf5dc32e05721 WHIRLPOOL cd1b3dbc9bd0a66d4e065249d29810b6c964f6ec4073491704e0c394c4090ccb7c9ec5455ba81df878408741a42642ea16644fe5163bdbe1c4fab5c5afe723be
+AUX extra/mplayer-stereoscopic-1.1.patch 8907 SHA256 781b2a3af616ab19767c67c97f9752fd3eca3410cbf89e3674386176ad9fc1f7 SHA512 82fcb3510c6ae6c82331fa7fa9f18e82c91125df03bf5cad766b4edaec3a88af1b706991f7bab6e9363f4adca216c6261c898b769aef88d0d0947b2b1c3c6d47 WHIRLPOOL 38d1338e66284f73d73ebd7974795ec33040503bd65e6e8adc7e506eb1be7affaaf1f9665257d0dd395168a3591085b9b720f3e2b5d0afd6fe236578531b1853
+AUX extra/mplayer-vaapi-1.1.patch 126945 SHA256 8fdffbca8c5a68a41c3b113f5ea4aeb6b7c485cbe9f480e1f152acc1d2935732 SHA512 f9cd10c2ec3ee155217b0043f1777ad50eb0ca53ab2e92c422b35aa377af68d6da98968f79071d591ec8a3ebefd7849deb5a250c4ac78c8eb0466f06792bd5c1 WHIRLPOOL 2c4859db073b72feff3b0db9aa4c000a4d6bb55b38cce4d05cedcb1286d9b4d1e39eacdd9b61b48f7ffeccd005855d11ab18be7dc68d22a474eee2d9e0ed38c1
+AUX extra/mplayer-vaapi_for_svn-35034.patch 126998 SHA256 499ac88eb824977825cd7a55ac53b1fcf377550d5e0c7e2a828363606ceabdcf SHA512 34c7056c05f5829e917a32c92464e46d3429e94e03432b21af9478ecbf7d09393aec8647df2ae01bff82a5f17a8be239f8ab61a36cb96458a2cac00e1b0c533d WHIRLPOOL 8f4a261d0a665b65e795a5905f9a8bd88e4d762a9ba384f612fdc907c416e49744a71e2040d35a9ce110e1476f3e38a6f5fd6b35fdf1d74f0ef404455da797ae
+AUX ffmpeg.patch 650 SHA256 70170f747f6f26700394a7646c8258aab5dcd9b96c17cb797d9d6e7d7bb02f52 SHA512 77627b5433e0dfe2bfd1c0e95fdab96461be6ee0e477a6667eda9147a7040f51e9235384cfb60b600ff76d23cfd225848850dea13c058e59d98b5c475e0f46f4 WHIRLPOOL 8bf98a4b532b083f848880b23749f8b08c1d908a16424d6ba240c99f006515c98a97b1b6381eb333116f4683de8e8163da84dcb2183ac7f5376db2ea229b42cf
+AUX ffmpeg2.patch 805 SHA256 41a7602b579bdfc8ea3078e1023fcb73de017354dd40148255411ad55bdbc3fa SHA512 b1668dea423412f4bf0306bd6658839398979da9e8a641d3748072c235aed801a83602ca83ba65213ce600e8c1b4bc66acf59e40cfa938c5f69b45ec0c89da37 WHIRLPOOL 211cbd1577da6b446d9eeac244d60d9d7bcd4c59dfe0aa09cd3b28cc6479bbcbfe2ccf8dbd512f54414b3795788d19d532850fbc32efb171e7c6865f616945ea
+AUX mplayer-1.0_rc4-pkg-config.patch 2751 SHA256 9c0e5654ef05d64ae8bb91e3204433559a1f576b663217c6119bd61cec2ae51c SHA512 cda6680ce0f02ae211686630e6e036e6432006b8936b0e37a5ceda74d73012d65b9262350aee936057d733e513016071ef41cda283023570c98d822dab866de9 WHIRLPOOL dae658443451ef61906ded5d5d2ba220756f6007a88823bfa52b2ede63cbdf521065cb38b9085f504cabc3a8cdbdb1f4f3d6f647085ac0d8a818885a2301c0db
+AUX mplayer-1.0_rc4_p20110322-gcc46.patch 657 SHA256 4c57d5c4c79db87796b6b1b4a485f4d0a8ed95f3ae71040592a0bd5f3dc070b2 SHA512 ac58403a087712e5151f7c7e39d073a3fd5362356e0ff972f87f619dfdbfe10289eaa32ebf44b99e3d5773d9642619379eb60de2a9d9b8c78704ba24ab55c09d WHIRLPOOL f011ed55bf199b32ea2d8a61ec44a61590d46e1007c945d0e835301f0286a64b2046cebb984056c7bea3410349548ac2ee7380f859033cf527d35612d70814d8
+AUX mplayer-1.0_rc4_p20110322-sami_subtitle_parsing.patch 417 SHA256 413876d32509c5e09df58b6f833036cb16d1073fcfecb17e0be9dc355d0e7160 SHA512 229e2ee01a32aac69299fa02990d924c34008b2116a8fdebf1785b54cc24dc52ec0ec0ecc20cc409a8cd975a3c533653c4ea9ccecd4e311105828605c0fff9d4 WHIRLPOOL f91b5ef9f66e3b68de177a187b03764bdfbbdae473b5d6c0c14c3e9eda14abd31666156df9fe9fc974176e37d234ed61780555b41d9944eb37dd000a4215560c
+AUX mplayer-1.1-codecid.patch 656 SHA256 3844fcbdb3113e805a4c1e9231e8ff9d93c1e8b5400778d29c1c3b485d0d0ddd SHA512 14c78953b9523badaeadb60a72e101fb4100802a312c2f30c1e4fdc2a6ff32cdd82193bbff8e9ee4b1448d6bb0f1d5662f12237a09d86f2993007793d5fc46b3 WHIRLPOOL 631a495288be4b48ef24a7960ba344628d522043831dcc5519d276880209b1422ad90cb9183a363d9c75ec14481a7ba5ea254bd446d639f5a41c194ef6cf73f1
+AUX mplayer-1.1-ffmpeg.patch 1452 SHA256 9c04f0a14f625a41a7bda49c5fc8d2622a85da349799904ec56244e87dd38d26 SHA512 23aaf6fc85101b92e81e37f39c2929874891387d15e420d524dc7248bcf995273d763b98ecf496e06d89a99b567631c5978adfda1f3ad076fbf980347ccf7e49 WHIRLPOOL 0549d6765bc7f22f325bab4a6a70dfe9827a48fd486aa8acc912e717948f814be695441ca70d38a7d074d38cfd5ce04c14a1bcc37b77475cc059a925b19d0305
+AUX prepare_mplayer.sh 758 SHA256 d8a92d83db920a3e47b864b24e78407c1ef5b2c523e91dceae2d96f5bcce435e SHA512 eea43b7816080b0ffbe48db56fffa4606c98ecf8ce8a44bd02b405b5744c024ef55705f53710b8d7b2750a1b7565905f5fa572c34982e1db66810c392584520c WHIRLPOOL 09b1c09fd5264887c5d59b8dbdb5cd08811f4d952bb254dcb4649e3a55d248b8f43c49c9da9d98caad6a5578f15e0e1b40f1d44826cf60cb338bf7b049c26ddb
+DIST MPlayer-1.1.tar.xz 11208088 SHA256 76cb47eadb52b420ca028276ebd8112114ad0ab3b726af60f07fb2f39dae6c9c SHA512 8a9b96155e6794273b1496ff4987b65db14cd5ba4359b52604c2afccc574d0a2328e86f2edf98e65283c380780b9a8b3094da18a161cf7aee090986d5776178a WHIRLPOOL 4555281efc31bf74d6a4eaf63eaf9ff1555fcb65889167ffc889b34dd341bba9437c95a1a556dd4aa291f23aa5ec705a6d110ce38bee79f7198e00346793a58f
+DIST font-arial-cp1250.tar.bz2 249705 SHA256 423a07e780bb130cd8e4730715545c5d919c248dda595aab7a0a01de3c83fd12 SHA512 4f77ff5ceb8ec6e5d9f8f34d8950a6a6276d1fd5a947772fcbdb6554988b1ea665c12b82f45164f91fb7bd08000cb4afc26fa35beb4c760464160e22b9b8c340 WHIRLPOOL d635f54be65b0ca1047d943b6f6da433cda9fce6ed74fcab993501cf7f6b443eb711e182cd7fff09e553d251b5fd1c60196aa22e8370cba99fa175ed5ecdb47f
+DIST font-arial-iso-8859-1.tar.bz2 234242 SHA256 9730f481764f367c9089d0166fb6ccf9148808ffbbfeca635cf0e6db75765d29 SHA512 a1d03b6f09c48f48b7733f3bc0402ceab239a9abf88b860d852ea9fe69b4da690208a79d6f29d30204f5b37becf10672e8e8c0bfef201846d80ec54df617d029 WHIRLPOOL 8050362b125d3ca98214526cee2fa685e31487d13a6483c765bfc844bdc5e07beeba2c1ba313458096d43a63edd6c5e80b8b388c2792fc0ec7421e4072d8ca25
+DIST font-arial-iso-8859-2.tar.bz2 222208 SHA256 71debfc960007c2f6242dfc91e8b1c005b30a99e129aeb00ab8c03f4371b41c1 SHA512 5671e628303fd816f64a51ad10e2f4dd9c3dc1b34c379a2ecf489b83931db7af668aaa4e00e96a00cacd63ed98daeae6b6a4d5925edfb06fc98d3a923f70257d WHIRLPOOL 08178087b4ea1dfb2250f4673785e31dd876b06af51c51b2bddc172b23e6e33cbc1b2c6b710a317e42dc05486974b26ed0ad3ca50a185567aa77d49bd1e72aee
+EBUILD mplayer-1.1-r1.ebuild 18177 SHA256 95445dbffe8b5689116dcf9d286d43f6b2366a6c7134f5425c9f5bf43d064967 SHA512 d45af4903a14a7eeb868075814a824bdb0d36b907cd209740a2637ae7a7303726b5a680f6944a0efe9a7f97fc8928f4eb6d46dc59585e74ec01b2ec522928d65 WHIRLPOOL 99513f28896044ac1607c08cdb040d86131123ee626f603676971e07f03ce78e9fbc267bf696594e843f016f5e27f472258cd4e7418a75ae3e639a1c8538e915
+EBUILD mplayer-1.1-r2.ebuild 19415 SHA256 5d06d2890c22ee5bfd2316bd0488e6c879ebc49c92ba42ae505411ca52807220 SHA512 3183e7b8b24d87c7a00f92921db7aa81af5c96b32873e3c40b0d5164078e18680fae854b33d564a6ae2298128ca5c00b43ab2bc86946d14fc79a389d4b24f854 WHIRLPOOL 670711c9b48f4fc6b20ddeca571c3b2c4b2949a394f381f3d11ceda423a5cab8e4553ecd4a83abcb683193cc80ee8091719c8088b77035b6bf41a34fdfac979b
+MISC ChangeLog 43071 SHA256 c90fd117a67c71958aa6ca19413ae83f979eeaa495671638c0da49ec0ce0e82b SHA512 d3ebc0ca86600ae8940bb14a3e1452eb9e697a37b1fc267588070768e3308137eca93923b1cb62c66361799d7b3912ab114db639a2029e1171eddc3859a9f3c9 WHIRLPOOL b52584005d24d76ef6a0c15a571390b5102b20bcd1ee08f72937a60a023121295de739aafaf64346f334c0e19b648810dacd0badb50ef8b73bcd20fef7582c49
+MISC ChangeLog-2008 107064 SHA256 d9949e0e21fd6fd00f1417201455ee399240ef1010dcf56611ac0fc1f6f9505b SHA512 622543b379b4c44f5845566b4e697bd92dd3e864e2f01a1b0f303c8ae5c7fb5de24839f6503765d51b4a3bfa777d175a7e410383e62ef2bbacf3e87cdc28c705 WHIRLPOOL e731af47505ffa646c92386dfb14acaffc2bb14ab4da74520c0b4dbc15ca5c20aacadbb53c4b91ba8d126a75bf7d2fb61877eeda354064e20c48cf4137bf6a74
+MISC metadata.xml 3656 SHA256 c24294ec6e43cde01922b7b2d705e35a8a85fd2d8aca70a291f00ee0d10b9b1b SHA512 95ca63129536cbff57226cbaa7cec1a954fa3e562a96df80cf920099896bc207b19967d671f8bbb824751d0fed28f218a2cecd297c6851704cab70bc8d4e06d9 WHIRLPOOL 03a16ba10f4c4ee2995565ea0bb55dd963bc142dac7fb2addd1ce4a71a5ce2d660289cad9d65e1b9eb48649be64359bb74cb1d19ac69aada252c4b769bef4f89
diff --git a/media-sound/mplayer/files/dump_ffmpeg.sh b/media-sound/mplayer/files/dump_ffmpeg.sh
new file mode 100755
index 0000000..77b836f
--- /dev/null
+++ b/media-sound/mplayer/files/dump_ffmpeg.sh
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+FFMPEG_DIR=ffmpeg
+FFMPEG_MOVED_DIR=ffmpeg_removed
+SYSTEM_FFMPEG_DIR=${EPREFIX}/usr/include
+
+# Move directories
+
+[ -d "${FFMPEG_DIR}" ] && mv "${FFMPEG_DIR}" "${FFMPEG_MOVED_DIR}"
+[ -d "${FFMPEG_MOVED_DIR}" ] || exit 1
+[ -d "${FFMPEG_DIR}" ] || mkdir "${FFMPEG_DIR}"
+
+# Keep required files and check them
+
+SANITIZED_REGEXP='^\#[[:space:]]*include.*\".*[.]h\"'
+sanitize_includes() {
+ sed -e "s/^\#[[:space:]]*include.*\"config[.]h\"/#include <config.h>/" \
+ -e "s/^\#[[:space:]]*include.*\"\(libav.*\/.*[.]h\)\"/#include \<\1\>/" \
+ -e "/${SANITIZED_REGEXP}/{s:\"\(.*\)\":\<${2}\/\1\>:}" ${1}
+}
+
+check_sanitized_includes() {
+ grep -q "${SANITIZED_REGEXP}" $1
+}
+
+get_header_deps() {
+ grep "^#[[:space:]]*include.*\<libav.*[.]h\>" ${1} | \
+ sed -e "s/^#[[:space:]]*include.*\<\(libav.*[.]h\)\>/\1/" | \
+ tr -d '<>' | tr '\n' ' '
+}
+
+check_header_deps() {
+ for i ; do
+ printf "Checking for the presence of ${i}...\n"
+ if [ ! -f "${SYSTEM_FFMPEG_DIR}/${i}" -a ! -f "${FFMPEG_DIR}/${i}" ] ; then
+ printf "Header depends on ${i}\n"
+ printf "... but that file cannot be found, aborting\n"
+ exit 1
+ fi
+ done
+}
+
+move_file() {
+ mydir="$(dirname $1)"
+ printf "Moving and checking file: ${1}\n"
+ [ -d "${FFMPEG_DIR}/${mydir}" ] || mkdir -p "${FFMPEG_DIR}/${mydir}"
+ if [ ! -f "${FFMPEG_DIR}/${1}" ] ; then
+ sanitize_includes "${FFMPEG_MOVED_DIR}/${1}" ${mydir} > "${FFMPEG_DIR}/${1}"
+ fi
+ if $(check_sanitized_includes "${FFMPEG_DIR}/${1}") ; then
+ printf "Error, found non sanitized file in ffmpeg:\n"
+ printf "${FFMPEG_DIR}/${1}\n"
+ printf "Please report it at bugs.gentoo.org\n"
+ exit 1
+ fi
+ if [ "${1%.h}" != "${1}" ] ; then
+ mydeps=$(get_header_deps "${FFMPEG_DIR}/${1}")
+ check_header_deps ${mydeps}
+ fi
+}
+
+# HEADERS (order matters for the consistency checks: leaves come first)
+FILES=" libavutil/x86_cpu.h \
+ libavformat/internal.h "
+# Files that are sed'ed but not compiled, used to check for availability of
+# some codecs
+FILES="${FILES} libavcodec/allcodecs.c libavformat/allformats.c libavfilter/allfilters.c"
+
+for i in ${FILES} ; do
+ move_file $i
+done
+
+rm -rf "${FFMPEG_MOVED_DIR}"
+
+exit 0
diff --git a/media-sound/mplayer/files/extra/mplayer-coreavc-1.1.patch b/media-sound/mplayer/files/extra/mplayer-coreavc-1.1.patch
new file mode 100644
index 0000000..a6f71bc
--- /dev/null
+++ b/media-sound/mplayer/files/extra/mplayer-coreavc-1.1.patch
@@ -0,0 +1,766 @@
+Index: libmpcodecs/vd.c
+===================================================================
+--- a/libmpcodecs/vd.c.orig 2010-03-12 07:47:10.000000000 -0800
++++ b/libmpcodecs/vd.c 2010-03-12 07:48:02.000000000 -0800
+@@ -40,6 +40,7 @@
+ extern const vd_functions_t mpcodecs_vd_ffmpeg;
+ extern const vd_functions_t mpcodecs_vd_theora;
+ extern const vd_functions_t mpcodecs_vd_dshow;
++extern const vd_functions_t mpcodecs_vd_dshowserver;
+ extern const vd_functions_t mpcodecs_vd_dmo;
+ extern const vd_functions_t mpcodecs_vd_vfw;
+ extern const vd_functions_t mpcodecs_vd_vfwex;
+@@ -71,6 +72,7 @@
+ #ifdef CONFIG_OGGTHEORA
+ &mpcodecs_vd_theora,
+ #endif
++ &mpcodecs_vd_dshowserver,
+ #ifdef CONFIG_WIN32DLL
+ &mpcodecs_vd_dshow,
+ &mpcodecs_vd_dmo,
+Index: Makefile
+===================================================================
+--- a/Makefile.orig 2010-03-12 07:47:19.000000000 -0800
++++ b/Makefile 2010-03-12 07:48:02.000000000 -0800
+@@ -20,6 +20,7 @@
+ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ include config.mak
++EXTRALIBS += -lrt
+
+ ###### variable declarations #######
+
+@@ -490,6 +491,7 @@
+ sub/sub_cc.c \
+ sub/subreader.c \
+ sub/vobsub.c \
++ libmpcodecs/vd_dshowserver.c \
+ $(SRCS_COMMON-yes) \
+ $(OS_FEATURE-no)
+
+
+@@ -908,6 +910,7 @@
+ libdvdcss/%: CFLAGS := -Ilibdvdcss -D_GNU_SOURCE -DVERSION=\"1.2.10\" $(CFLAGS_LIBDVDCSS) $(CFLAGS)
+ libdvdnav/%: CFLAGS := -Ilibdvdnav -D_GNU_SOURCE -DHAVE_CONFIG_H -DVERSION=\"MPlayer-custom\" $(CFLAGS)
+ libdvdread4/%: CFLAGS := -Ilibdvdread4 -D_GNU_SOURCE $(CFLAGS_LIBDVDCSS_DVDREAD) $(CFLAGS)
++libmpcodecs/%: CFLAGS := $(CFLAGS) -g -O0
+
+ loader/%: CFLAGS += -fno-omit-frame-pointer $(CFLAGS_NO_OMIT_LEAF_FRAME_POINTER)
+ #loader/%: CFLAGS += -Ddbg_printf=__vprintf -DTRACE=__vprintf -DDETAILED_OUT
+Index: libmpcodecs/vd_dshowserver.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ b/libmpcodecs/vd_dshowserver.c 2010-03-12 07:56:33.000000000 -0800
+@@ -0,0 +1,295 @@
++/*
++ * Copyright Alan Nisota 2006 - 2010
++ * To use this code, make sureyour codecs.conf file has been updated with this section:
++ * videocodec coreserve
++ * info "CoreAVC DShowServer"
++ * status untested
++ * format 0x10000005
++ * fourcc H264,h264
++ * fourcc X264,x264
++ * fourcc avc1,AVC1 AVC1
++ * fourcc davc,DAVC
++ * fourcc VSSH
++ * driver dshowserver
++ * dll "CoreAVCDecoder.ax"
++ * guid 0x09571a4b, 0xf1fe, 0x4c60, 0x97, 0x60, 0xde, 0x6d, 0x31, 0x0c, 0x7c, 0x31
++ * out YV12,IYUV,I420,YUY2
++ *
++ * Codec is very sensitive to the fourcc value. As of 2009-08-30, mplayer incorrectly reports
++ * AVC1 as H264 when using lavf decoder, resulting in breakage.
++ * this can be corrected by using an alternate demuxer (-demuxer mov for example)
++ * or by adding this to the above file:
++ * fourcc H264,h264 AVC1
++ * though that may break regular h264 playback
++ */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <stdarg.h>
++#include <sys/mman.h>
++#include <pthread.h>
++
++#include <sys/types.h>
++#include <unistd.h>
++#include <sys/stat.h>
++#include <fcntl.h>
++#include <time.h>
++#include <sys/wait.h>
++
++#include "config.h"
++
++#include "mp_msg.h"
++
++#include "vd_internal.h"
++
++struct vd_struct {
++ union {
++ uint32_t ret;
++ uint32_t cmd;
++ };
++ uint32_t buflen;
++ uint64_t pts;
++ uint32_t unused[8];
++} __attribute__((__packed__));
++
++enum {
++ VD_END = 1,
++ VD_DECODE = 2,
++ VD_SEEK = 3,
++ VD_HAS_BIH = 0x10000,
++ VD_VERSION_MASK = 0xFFFF,
++};
++#include "timeout_sem.c"
++
++static vd_info_t info = {
++ "DirectShowServer video codecs",
++ "dshowserver",
++ "Alan Nisota",
++ "based on dshow",
++ "win32 codecs"
++};
++
++LIBVD_EXTERN(dshowserver)
++typedef struct {
++ int fd;
++ void *mem;
++ char *data;
++ char *picture;
++ int picsize;
++ int pagesize;
++ void *sem;
++ struct vd_struct *vd;
++} ds_mpi_t;
++static ds_mpi_t *ds_mpi;
++
++// to set/get/query special features/parameters
++static int control(sh_video_t *sh __attribute((unused)),int cmd,void* arg __attribute((unused)),...){
++ switch(cmd){
++ case VDCTRL_RESYNC_STREAM:
++ printf("Seek now\n");
++ ds_mpi->vd->cmd = VD_SEEK; //'3' is cmd for seek
++ timed_sempost(ds_mpi->sem);
++ timed_semwait(ds_mpi->sem, 10);
++ return CONTROL_TRUE;
++ case VDCTRL_QUERY_MAX_PP_LEVEL:
++ return 4;
++ case VDCTRL_QUERY_UNSEEN_FRAMES:
++ return 10;
++
++ }
++ return CONTROL_UNKNOWN;
++}
++
++static int my_system(const char *command)
++{
++ pid_t child = fork();
++
++ if (child < 0)
++ {
++ /* Fork failed */
++ return child;
++ }
++ else if (child == 0)
++ {
++ /* Child */
++ int i;
++ /* Close all open file descriptors except stdout/stderr */
++ for (i = sysconf(_SC_OPEN_MAX) - 1; i > 2; i--)
++ close(i);
++
++ /* Attach stdin to /dev/null */
++ /*
++ close(0);
++ int fd = open("/dev/null", O_RDONLY);
++ dup2(fd, 0);
++ if (fd != 0)
++ close(fd);
++ */
++ /* Run command */
++ execl("/bin/sh", "sh", "-c", command, NULL);
++ _exit(0);
++ }
++ else
++ {
++ /* Parent */
++ int status;
++
++ waitpid(child, &status, 0);
++ return status;
++ }
++
++ return 1;
++}
++
++// init driver
++static int init(sh_video_t *sh){
++ int ret;
++ char cmd[255], shm[80], id[80];
++ uint32_t out_fmt;
++ int bpp, w, h;
++ int extra = 0;
++ int numpages = 10;
++ int port = 0;
++ int memsize;
++
++ init_twait();
++ w = sh->disp_w; h = sh->disp_h;
++ if(!mpcodecs_config_vo(sh,w,h,IMGFMT_YUY2)) return 0;
++ out_fmt = sh->codec->outfmt[sh->outfmtidx];
++ switch(out_fmt){
++ case IMGFMT_YUY2:
++ case IMGFMT_UYVY:
++ bpp = 16; break;
++ case IMGFMT_YV12:
++ case IMGFMT_I420:
++ case IMGFMT_IYUV:
++ bpp = 12; break;
++ case IMGFMT_YVU9:
++ bpp = 9; break;
++ default:
++ bpp = 24; break;
++ }
++ sprintf(id, "%x", *(int *)pthread_self());
++ snprintf(shm, 80, "/dshow_shm.%s", id);
++
++ ds_mpi = (ds_mpi_t *) malloc(sizeof(ds_mpi_t));
++ ds_mpi->fd = shm_open(shm, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
++ ds_mpi->picsize = w * h * bpp / 8;
++ ds_mpi->pagesize = ds_mpi->picsize + 1024;
++ memsize = sizeof(struct vd_struct) + w * h + ds_mpi->picsize + extra + ds_mpi->pagesize * numpages;
++ ftruncate(ds_mpi->fd, memsize);
++ ds_mpi->mem = mmap(NULL, memsize, PROT_READ | PROT_WRITE, MAP_SHARED, ds_mpi->fd, 0);
++ if(ds_mpi->mem == MAP_FAILED) {
++ perror("mmap");
++ return 0;
++ }
++ memset((char *)ds_mpi->mem, 0, sizeof(struct vd_struct));
++ if (extra)
++ memset((char *)ds_mpi->mem + (memsize - extra), 0, extra);
++ ds_mpi->vd = (struct vd_struct *)ds_mpi->mem;
++ ds_mpi->data = ((char *)ds_mpi->mem) + sizeof(struct vd_struct);
++ ds_mpi->picture = ds_mpi->data + w * h;
++ if(sh->bih->biWidth && sh->bih->biHeight) {
++ ds_mpi->vd->cmd |= VD_HAS_BIH; //Use embedded bih
++ memcpy(ds_mpi->data, sh->bih, sh->bih->biSize);
++ }
++
++ ds_mpi->sem = timed_seminit(DS_SOCKET, &port, 1);
++ //ds_mpi->sem = timed_seminit(DS_SEMAPHORE, id, 1);
++
++ snprintf(cmd, 255, "dshowserver --codec %s --size %dx%d "
++ "--guid %08x-%04x-%04x-%02x%02x%02x%02x%02x%02x%02x%02x "
++ "--fourc 0x%08x --bits %d --outfmt 0x%08x --pid %d --id %s "
++ "--numpages %d --port %d %s&",
++ sh->codec->dll, w, h,
++ (unsigned int)sh->codec->guid.f1, sh->codec->guid.f2, sh->codec->guid.f3,
++ sh->codec->guid.f4[0], sh->codec->guid.f4[1], sh->codec->guid.f4[2], sh->codec->guid.f4[3],
++ sh->codec->guid.f4[4], sh->codec->guid.f4[5], sh->codec->guid.f4[6], sh->codec->guid.f4[7],
++ (unsigned int)sh->format, bpp, out_fmt, getpid(), id, numpages, port, "");
++ printf("%s\n", cmd);
++ my_system(cmd);
++ ret = timed_semwait(ds_mpi->sem, 10);
++ shm_unlink(shm);
++ if(ret <= 0) {
++ printf("DirectShow filter failed");
++ return 0;
++ } else {
++ printf("Found DirectShow filter");
++ return 1;
++ }
++}
++
++// uninit driver
++static void uninit(sh_video_t *sh __attribute((unused))){
++ if(ds_mpi) {
++ printf("Destroying filter");
++ ds_mpi->vd->cmd = VD_END; //'1' is cmd for terminating
++ timed_sempost(ds_mpi->sem);
++ close(ds_mpi->fd);
++ timed_semdelete(ds_mpi->sem);
++ free(ds_mpi);
++ ds_mpi = NULL;
++ }
++}
++
++//mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h);
++
++// decode a frame
++static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
++ mp_image_t* mpi = NULL;
++ int ret;
++ unsigned char *t;
++
++ if(len<=0) return NULL; // skipped frame
++
++ ds_mpi->vd->cmd = VD_DECODE; //'2' is cmd for decoding
++ ds_mpi->vd->pts = (uint64_t)(1E9* (sh->num_buffered_pts ? sh->buffered_pts[0] : sh->pts));
++ memcpy(ds_mpi->data, data, len);
++ if (0) {
++ static int count = 0;
++ char f[80];
++ FILE *fh;
++
++ if(count == 100)
++ exit(1);
++ sprintf(f, "/tmp/mplayer.%d", count++);
++ fh = fopen(f, "w+");
++ fwrite(data, len, 1, fh);
++ fclose(fh);
++ }
++ ds_mpi->vd->buflen = len;
++ timed_sempost(ds_mpi->sem);
++ ret = timed_semwait(ds_mpi->sem, 10);
++ if(flags&3) {
++ // framedrop:
++ return NULL;
++ }
++ //printf("len: %d, PTS (ret:%d,vd_ret:%d): %f -> %f\n", len, ret, ds_mpi->vd->ret, sh->buffered_pts[0], (double)ds_mpi->vd->pts/1E9);
++ //printf("PTS (%d): %f(%d) -> %d\n", ds_mpi->vd->ret, sh->buffered_pts[0], pts-1, ds_mpi->vd->pts);
++ if(ret == 1 && ds_mpi->vd->ret && ! (ds_mpi->vd->ret & (1<<31))) {
++ if(ds_mpi->vd->pts)
++ sh->buffered_pts[0] = (double)ds_mpi->vd->pts/1E9;
++ mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_COMMON_PLANE|MP_IMGFLAG_COMMON_STRIDE,
++ sh->disp_w, sh->disp_h);
++ if(ds_mpi->vd->ret & 0x02) {
++ unsigned char page = ds_mpi->vd->ret >> 8;
++ mpi->planes[0]=ds_mpi->picture + ds_mpi->picsize + page * ds_mpi->pagesize;
++ } else {
++ mpi->planes[0]=ds_mpi->picture;
++ }
++ if (mpi->flags&MP_IMGFLAG_PLANAR) {
++ mpi->stride[0] = mpi->width;
++ mpi->stride[1] = mpi->stride[2] = mpi->width >> mpi->chroma_x_shift;
++ mpi->planes[2] = mpi->planes[0] + mpi->stride[0] * mpi->height;
++ mpi->planes[1] = mpi->planes[2] + (mpi->width >> mpi->chroma_x_shift) * (mpi->height >> mpi->chroma_y_shift);
++ if (mpi->flags&MP_IMGFLAG_SWAPPED) {
++ t = mpi->planes[1];
++ mpi->planes[1] = mpi->planes[2];
++ mpi->planes[2] = t;
++ }
++ } else {
++ mpi->stride[0]=mpi->bpp*mpi->width/8;
++ }
++ }
++ return mpi;
++}
+Index: libmpcodecs/timeout_sem.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ b/libmpcodecs/timeout_sem.c 2010-03-12 08:03:16.000000000 -0800
+@@ -0,0 +1,397 @@
++#include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <fcntl.h>
++#include <errno.h>
++#include <string.h>
++
++#ifndef __MINGW32__
++ #include <netdb.h>
++ #include <netinet/in.h>
++ #include <sys/socket.h>
++ #include <arpa/inet.h>
++ #include <sys/wait.h>
++
++ #define DS_EINPROGRESS EINPROGRESS
++ #define DS_ETIMEDOUT ETIMEDOUT
++ #define DS_EWOULDBLOCK EWOULDBLOCK
++#else
++ #define _WIN32_WINNT 0x0501
++ #include <windows.h>
++ #include <winsock2.h>
++ #include <ws2tcpip.h>
++
++ #define DS_EINPROGRESS WSAEINPROGRESS
++ #define DS_ETIMEDOUT WSAETIMEDOUT
++ #define DS_EWOULDBLOCK WSAEWOULDBLOCK
++#endif
++
++#include "timeout_sem.h"
++#ifdef __MINGW32__
++ #undef DS_SEMAPHORE
++#endif
++
++#ifdef DS_SEMAPHORE
++#include <time.h>
++#include <semaphore.h>
++#endif
++
++struct sem {
++ int type;
++ int initialized;
++ int sockfd;
++ int listenfd;
++ void *id;
++ char mutex_rx[1];
++ char mutex_tx[1];
++#ifdef DS_SEMAPHORE
++ sem_t *sem_rd;
++ sem_t *sem_wr;
++#endif /*DS_SEMAPHORE*/
++};
++
++#ifdef DS_SEMAPHORE
++#ifdef __APPLE__
++ static void ALRMhandler(int sig) {
++ }
++ static int sem_twait(sem_t *sem, int t) {
++ int ret;
++ alarm(t);
++ ret = sem_wait(sem);
++ printf("twait complete\n");
++ return ret;
++ }
++ static void init_twait() {
++ sigset_t none;
++ struct sigaction sa;
++ sigemptyset(&none);
++ sigprocmask(SIG_SETMASK, &none, 0);
++
++ sa.sa_handler = ALRMhandler;
++ sa.sa_flags = 0;
++ sigemptyset(&sa.sa_mask);
++ sigaction(SIGALRM, &sa, 0);
++ }
++#else
++ static int sem_twait(sem_t *sem, int t) {
++ struct timespec ts;
++ clock_gettime(CLOCK_REALTIME, &ts);
++ ts.tv_sec += t;
++ return(sem_timedwait(sem, &ts));
++ }
++ static void init_twait() {}
++#endif
++#endif /*DS_SEMAPHORE */
++
++static int setblocking(int sock, int block)
++{
++ unsigned long opts;
++#ifndef __MINGW32__
++ opts = fcntl(sock,F_GETFL);
++ if (opts < 0) {
++ perror("fcntl(F_GETFL)");
++ exit(EXIT_FAILURE);
++ }
++ opts = block ? (opts & ~O_NONBLOCK)
++ : (opts | O_NONBLOCK);
++ if (fcntl(sock,F_SETFL,opts) < 0) {
++ perror("fcntl(F_SETFL)");
++ exit(EXIT_FAILURE);
++ }
++#else
++ opts = !(block);
++ if ( ioctlsocket( sock, FIONBIO, &opts ) == SOCKET_ERROR )
++ {
++ perror("ioctlsocket");
++ exit(EXIT_FAILURE);
++ }
++#endif
++ return 0;
++}
++
++static int timed_connect(int sockfd, const struct sockaddr *serv_addr,
++ socklen_t addrlen, int secs) {
++ //Socket should already be non-blocking
++ int res;
++ fd_set myset;
++ struct timeval tv;
++ int valopt;
++ socklen_t lon;
++
++ // Trying to connect with timeout
++ res = connect(sockfd, serv_addr, addrlen);
++ if (res < 0 ) {
++ if (errno == DS_EINPROGRESS || errno == DS_EWOULDBLOCK || errno == 0) {
++ fprintf(stderr, "EINPROGRESS in connect() - selecting\n");
++ do {
++ tv.tv_sec = secs;
++ tv.tv_usec = 0;
++ FD_ZERO(&myset);
++ FD_SET(sockfd, &myset);
++ res = select(sockfd+1, NULL, &myset, &myset, &tv);
++ if (res < 0 && errno != EINTR) {
++ fprintf(stderr, "Error connecting (select) %d - %s\n", errno, strerror(errno));
++ return -1;
++ }
++ else if (res > 0) {
++ // Socket selected for write
++ lon = sizeof(int);
++ if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon) < 0) {
++ fprintf(stderr, "Error in getsockopt() %d - %s\n", errno, strerror(errno));
++ return -1;
++ }
++ // Check the value returned...
++ if (valopt) {
++ fprintf(stderr, "Error in delayed connection() %d - %s\n", valopt, strerror(valopt)
++);
++ return -1;
++ }
++ break;
++ }
++ else {
++ fprintf(stderr, "Timeout in select() - Cancelling!\n");
++ return -1;
++ }
++ } while (1);
++ }
++ else {
++ fprintf(stderr, "Error connecting (connect) %d - %s\n", errno, strerror(errno));
++ return -1;
++ }
++ }
++ // I hope that is all
++ return 0;
++}
++static int timed_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int secs) {
++ //Socket should already be non-blocking
++ int res;
++ fd_set myset;
++ struct timeval tv;
++
++ tv.tv_sec = secs;
++ tv.tv_usec = 0;
++ FD_ZERO(&myset);
++ FD_SET(sockfd, &myset);
++ res = select(sockfd+1, &myset, NULL, NULL, &tv);
++ if (res < 0 && errno != EINTR) {
++ fprintf(stderr, "Error accepting %d - %s\n", errno, strerror(errno));
++ return -1;
++ }
++ else if (res > 0) {
++ // Socket selected for read
++ return accept(sockfd, NULL, NULL);
++ }
++ errno = DS_ETIMEDOUT;
++ return -1;
++}
++static int timed_recv(int sockfd, void *buf, size_t len, int flags, int secs) {
++ //Socket should already be non-blocking
++ int res;
++ fd_set myset;
++ struct timeval tv;
++
++ tv.tv_sec = secs;
++ tv.tv_usec = 0;
++ FD_ZERO(&myset);
++ FD_SET(sockfd, &myset);
++ res = select(sockfd+1, &myset, NULL, NULL, &tv);
++ if (res < 0 && errno != EINTR) {
++ fprintf(stderr, "Error accepting %d - %s\n", errno, strerror(errno));
++ return -1;
++ }
++ else if (res > 0) {
++ // Socket selected for read
++ return recv(sockfd, buf, len, flags);
++ }
++ errno = DS_ETIMEDOUT;
++ return -1;
++}
++
++static int timed_sockinit(int *port, int is_server)
++{
++ int sockfd; // listen on sock_fd
++ struct sockaddr_in my_addr;
++ socklen_t peer_addr_size = sizeof(struct sockaddr_in);
++ int yes=1;
++
++#ifdef __MINGW32__
++ WSADATA wsaData;
++ if(WSAStartup(MAKEWORD(2, 2), &wsaData) !=0) {
++ printf("WSAStartup failed\n");
++ exit(1);
++ }
++#endif
++
++ memset(&my_addr, 0, sizeof(my_addr));
++ my_addr.sin_family = AF_INET;
++ my_addr.sin_addr.s_addr=INADDR_ANY;
++ my_addr.sin_port = *port;
++ if ((sockfd = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
++ perror("server: socket");
++ exit(1);
++ }
++
++ setblocking(sockfd, 0);
++ if (is_server) {
++ if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (const char *)&yes,
++ sizeof(int)) == -1) {
++ perror("setsockopt");
++ exit(1);
++ }
++
++ if (bind(sockfd, (struct sockaddr *) &my_addr, sizeof(struct sockaddr_in)) == -1) {
++ close(sockfd);
++ perror("server: bind");
++ exit(1);
++ }
++ if (listen(sockfd, 1) == -1) {
++ perror("listen");
++ exit(1);
++ }
++ if (getsockname(sockfd, (struct sockaddr *)&my_addr, &peer_addr_size) == -1) {
++ perror("getsockname");
++ exit(1);
++ }
++ if(my_addr.sin_port == 0) {
++ printf("Failed to get port\n");
++ exit(1);
++ }
++ *port = my_addr.sin_port;
++ } else {
++ if (timed_connect(sockfd, (struct sockaddr *) &my_addr, sizeof(struct sockaddr_in), 10) == -1)
++ {
++ close(sockfd);
++ perror("client: connect");
++ exit(1);
++ }
++ }
++
++ return sockfd;
++}
++
++int timed_semwait(void *_sem, int secs) {
++ struct sem *sem = (struct sem *)_sem;
++ int ok = -1;
++ if(sem->type == DS_SOCKET) {
++ if(! sem->initialized) {
++ ok = timed_accept(sem->sockfd, NULL, NULL, secs);
++ if(ok != -1) {
++ sem->listenfd = sem->sockfd;
++ sem->sockfd = ok;
++ ok = 1;
++ sem->initialized = 1;
++ }
++ } else {
++ ok = (timed_recv(sem->sockfd, sem->mutex_rx, 1, 0, secs) == 1);
++ }
++ }
++#ifdef DS_SEMAPHORE
++ else if(sem->type == DS_SEMAPHORE) {
++ ok = (sem_twait(sem->sem_rd, secs) == 0);
++ if(! sem->initialized) {
++ timed_semclean(sem);
++ sem->initialized = 1;
++ }
++ }
++#endif
++ if(!ok && errno == DS_ETIMEDOUT) {
++ ok = DS_TIMEOUT;
++ }
++ return ok;
++}
++
++void timed_sempost(void *_sem) {
++ struct sem *sem = (struct sem *)_sem;
++ if(sem->type == DS_SOCKET) {
++ send(sem->sockfd, sem->mutex_tx, 1, 0);
++ }
++#ifdef DS_SEMAPHORE
++ else if(sem->type == DS_SEMAPHORE) {
++ sem_post(sem->sem_wr);
++ }
++#endif
++}
++
++void timed_semclean(void * _sem) {
++#ifdef DS_SEMAPHORE
++ struct sem *sem = (struct sem *) _sem;
++ if(sem->type == DS_SEMAPHORE) {
++ char sem1[80], sem2[80];
++ snprintf(sem1, 80, "/dshow_sem1.%s", (char *)sem->id);
++ snprintf(sem2, 80, "/dshow_sem2.%s", (char *)sem->id);
++ sem_unlink(sem1);
++ sem_unlink(sem2);
++ }
++#endif
++}
++
++void *timed_seminit(unsigned int semtype, void *id, int is_host) {
++ struct sem *sem;
++ sem = (struct sem *)malloc(sizeof(struct sem));
++ memset(sem, 0, sizeof(struct sem));
++ sem->type = semtype;
++ sem->id = id;
++ sem->initialized = !(is_host);
++ if(semtype == DS_SOCKET) {
++ sem->listenfd = -1;
++ sem->sockfd = timed_sockinit((int *)id, is_host);
++ if(sem->sockfd == -1) {
++ perror("sock_init");
++ exit(1);
++ }
++ }
++#ifdef DS_SEMAPHORE
++ else if(semtype == DS_SEMAPHORE) {
++ char semrd[80], semwr[80];
++ init_twait();
++ snprintf(semrd, 80, "/dshow_sem%d.%s", is_host ? 2 : 1, (char *)id);
++ snprintf(semwr, 80, "/dshow_sem%d.%s", is_host ? 1 : 2, (char *)id);
++ if(is_host) {
++ sem->sem_rd = sem_open(semrd, O_CREAT, 0644, 0);
++ sem->sem_wr = sem_open(semwr, O_CREAT, 0644, 0);
++ } else {
++ sem->sem_rd = sem_open(semrd, 0);
++ sem->sem_wr = sem_open(semwr, 0);
++ sem_unlink(semwr);
++ sem_unlink(semrd);
++ }
++ if(sem->sem_rd == SEM_FAILED) {
++ timed_semclean(sem);
++ perror("sem_open(1)");
++ exit(1);
++ }
++ if(sem->sem_wr == SEM_FAILED) {
++ timed_semclean(sem);
++ perror("sem_open(2)");
++ exit(1);
++ }
++ //tell calling procedure that we are awake;
++ if(! is_host) {
++ sem_post(sem->sem_wr);
++ }
++ }
++#endif /*DS_SEMAPHORE*/
++ else {
++ fprintf(stderr, "Unknown type specified: %d\n", semtype);
++ exit(1);
++ }
++ return sem;
++}
++
++void timed_semdelete(void *_sem) {
++ struct sem *sem = (struct sem *) _sem;
++ if(sem->type == DS_SOCKET) {
++ close(sem->sockfd);
++ if(sem->listenfd != -1)
++ close(sem->listenfd);
++#ifdef DS_SEMAPHORE
++ } else if(sem->type == DS_SEMAPHORE) {
++ if(! sem->initialized)
++ timed_semclean(sem);
++ sem_close(sem->sem_wr);
++ sem_close(sem->sem_rd);
++#endif
++ }
++ free(sem);
++}
++
+Index: libmpcodecs/timeout_sem.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ b/libmpcodecs/timeout_sem.h 2010-03-12 07:48:02.000000000 -0800
+@@ -0,0 +1,10 @@
++#define DS_SOCKET 0x01
++#define DS_SEMAPHORE 0x02
++
++#define DS_TIMEOUT -1
++
++void *timed_seminit(unsigned int semtype, void *id, int is_host);
++void timed_semclean(void *_sem);
++void timed_sempost(void *_sem);
++int timed_semwait(void *_sem, int secs);
++void timed_semdelete(void *_sem);
diff --git a/media-sound/mplayer/files/extra/mplayer-orderedmkv-1.1-need_fixing.patch b/media-sound/mplayer/files/extra/mplayer-orderedmkv-1.1-need_fixing.patch
new file mode 100644
index 0000000..32093ef
--- /dev/null
+++ b/media-sound/mplayer/files/extra/mplayer-orderedmkv-1.1-need_fixing.patch
@@ -0,0 +1,703 @@
+From 58497380e5222749892414089d26916095c0485c Mon Sep 17 00:00:00 2001
+From: Uoti Urpala <uau@glyph.nonexistent.invalid>
+Date: Sun, 29 Mar 2009 22:45:06 +0300
+Subject: [PATCH 1/1] Initial ordered chapters support
+
+Add basic support for Matroska ordered chapters. The switching between
+segments is implemented as a general edit timeline that could also be
+used for other purposes.
+
+Some things still need improvement. In particular the current code
+does not try to do any proper mapping between audio/video/subtitle
+streams of different files and there should be options for better
+control of how MPlayer searches other files for the required content.
+---
+ Makefile | 1 +
+ command.c | 2 +-
+ mencoder.c | 2 +-
+ mp_core.h | 18 +++
+ mpcommon.c | 7 +-
+ mpcommon.h | 3 +-
+ mplayer.c | 330 +++++++++++++++++++++++++++++++++++++++++++++++++---
+ osdep/findfiles.c | 97 ++++++++++++++++
+ osdep/findfiles.h | 2 +
+ 9 files changed, 437 insertions(+), 25 deletions(-)
+ create mode 100644 osdep/findfiles.c
+ create mode 100644 osdep/findfiles.h
+
+diff --git a/Makefile b/Makefile
+index 914df40..b1dd5b5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -473,6 +473,7 @@ SRCS_COMMON = asxparser.c \
+ libmpdemux/video.c \
+ libmpdemux/yuv4mpeg.c \
+ libmpdemux/yuv4mpeg_ratio.c \
++ osdep/findfiles.c \
+ osdep/$(GETCH) \
+ osdep/$(TIMER) \
+ stream/open.c \
+diff --git a/command.c b/command.c
+index 8fc8c85..7c03523 100644
+--- a/command.c
++++ b/command.c
+@@ -1597,7 +1597,7 @@ static int mp_property_sub(m_option_t *prop, int action, void *arg,
+ pts = mpctx->sh_audio->pts;
+ if (mpctx->sh_video)
+ pts = mpctx->sh_video->pts;
+- update_subtitles(mpctx->sh_video, pts, d_sub, 1);
++ update_subtitles(mpctx->sh_video, pts, d_sub, 0, 1);
+
+ return M_PROPERTY_OK;
+ }
+diff --git a/mencoder.c b/mencoder.c
+index 1661722..6fb7f03 100644
+--- a/mencoder.c
++++ b/mencoder.c
+@@ -1631,7 +1631,7 @@ if(sh_audio && !demuxer2){
+ }
+ else
+ #endif
+- update_subtitles(sh_video, sh_video->pts, d_dvdsub, 0);
++ update_subtitles(sh_video, sh_video->pts, d_dvdsub, 0, 0);
+
+ frame_data = (s_frame_data){ .start = NULL, .in_size = 0, .frame_time = 0., .already_read = 0 };
+
+diff --git a/mp_core.h b/mp_core.h
+index 13c8f14..6b7719b 100644
+--- a/mp_core.h
++++ b/mp_core.h
+@@ -67,6 +67,17 @@ enum exit_reason {
+ EXIT_ERROR
+ };
+
++struct content_source {
++ struct stream *stream;
++ struct demuxer *demuxer;
++};
++
++struct timeline_part {
++ double start;
++ double source_start;
++ struct content_source *source;
++};
++
+ typedef struct MPContext {
+ int osd_show_percentage;
+ int osd_function;
+@@ -77,6 +87,13 @@ typedef struct MPContext {
+ int play_tree_step;
+ int loop_times;
+
++ struct content_source *sources;
++ int num_sources;
++ struct timeline_part *timeline;
++ int num_timeline_parts;
++ int timeline_part;
++ double video_offset;
++
+ stream_t *stream;
+ demuxer_t *demuxer;
+ sh_audio_t *sh_audio;
+diff --git a/mpcommon.c b/mpcommon.c
+index 99d70c0..e649f3e 100644
+--- a/mpcommon.c
++++ b/mpcommon.c
+@@ -103,7 +103,8 @@ if (HAVE_CMOV)
+ #endif /* ARCH_X86 */
+ }
+
+-void init_vo_spudec(struct stream *stream, struct sh_video *sh_video, struct sh_sub *sh_sub)
++void init_vo_spudec(struct stream *stream, struct sh_video *sh_video, struct sh_sub *sh_sub,
++ double video_offset, int reset)
+ {
+ unsigned width, height;
+ spudec_free(vo_spudec);
+@@ -254,6 +255,6 @@ void init_vo_spudec(struct stream *stream, struct sh_video *sh_video, struct sh_sub *sh_sub)
+ if (d_dvdsub->non_interleaved)
+ ds_get_next_pts(d_dvdsub);
+ while (1) {
+- double subpts = curpts;
++ double subpts = curpts + video_offset;
+ type = orig_type;
+ len = ds_get_packet_sub(d_dvdsub, &packet, &subpts, &endpts);
+ if (len < 0)
+diff --git a/mpcommon.h b/mpcommon.h
+index a0c6fb8..c9bfd92 100644
+--- a/mpcommon.h
++++ b/mpcommon.h
+@@ -72,7 +72,8 @@ extern const m_option_t noconfig_opts[];
+
+ void print_version(const char* name);
+ void init_vo_spudec(struct stream *stream, struct sh_video *sh_video, struct sh_sub *sh_sub);
+-void update_subtitles(struct sh_video *sh_video, double refpts, demux_stream_t *d_dvdsub, int reset);
++void update_subtitles(struct sh_video *sh_video, double refpts, demux_stream_t *d_dvdsub,
++ double video_offset, int reset);
+ void update_teletext(struct sh_video *sh_video, demuxer_t *demuxer, int reset);
+ int select_audio(demuxer_t* demuxer, int audio_id, char* audio_lang);
+ void set_osd_subtitle(subtitle *subs);
+diff --git a/mplayer.c b/mplayer.c
+index 50f1ec4..84b9d6a 100644
+--- a/mplayer.c
++++ b/mplayer.c
+@@ -125,6 +125,7 @@
+ #include "sub/eosd.h"
+ #include "osdep/getch2.h"
+ #include "osdep/timer.h"
++#include "osdep/findfiles.h"
+
+ #include "udp_sync.h"
+
+@@ -565,6 +566,20 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask){
+ if(mask&INITIALIZED_DEMUXER){
+ mpctx->initialized_flags&=~INITIALIZED_DEMUXER;
+ current_module="free_demuxer";
++ if (mpctx->num_sources) {
++ mpctx->demuxer = mpctx->sources[0].demuxer;
++ for (int i = 1; i < mpctx->num_sources; i++) {
++ free_stream(mpctx->sources[i].stream);
++ free_demuxer(mpctx->sources[i].demuxer);
++ }
++ }
++ talloc_free(mpctx->sources);
++ mpctx->sources = NULL;
++ mpctx->num_sources = 0;
++ talloc_free(mpctx->timeline);
++ mpctx->timeline = NULL;
++ mpctx->num_timeline_parts = 0;
++ mpctx->video_offset = 0;
+ if(mpctx->demuxer){
+ mpctx->stream=mpctx->demuxer->stream;
+ free_demuxer(mpctx->demuxer);
+@@ -1493,8 +1508,13 @@ static void update_osd_msg(struct MPContext *mpctx)
+ char osd_text_timer[128];
+
+ if (mpctx->add_osd_seek_info) {
+- set_osd_bar(mpctx, 0, "Position", 0, 100,
+- demuxer_get_percent_pos(mpctx->demuxer));
++ double percentage;
++ if (mpctx->timeline && mpctx->sh_video)
++ percentage = mpctx->sh_video->pts * 100 /
++ mpctx->timeline[mpctx->num_timeline_parts].start;
++ else
++ percentage = demuxer_get_percent_pos(mpctx->demuxer);
++ set_osd_bar(mpctx, 0, "Position", 0, 100, percentage);
+ if (mpctx->sh_video)
+ mpctx->osd_show_percentage_until = (GetTimerMS() + 1000) | 1;
+ mpctx->add_osd_seek_info = false;
+@@ -1513,13 +1533,21 @@ static void update_osd_msg(struct MPContext *mpctx)
+ if(mpctx->sh_video) {
+ // fallback on the timer
+ if (opts->osd_level >= 2) {
+- int len = demuxer_get_time_length(mpctx->demuxer);
++ int len;
++ if (mpctx->timeline)
++ len = mpctx->timeline[mpctx->num_timeline_parts].start;
++ else
++ len = demuxer_get_time_length(mpctx->demuxer);
+ int percentage = -1;
+ char percentage_text[10];
+ int pts = demuxer_get_current_time(mpctx->demuxer);
+
+ if (mpctx->osd_show_percentage_until)
+- percentage = demuxer_get_percent_pos(mpctx->demuxer);
++ if (mpctx->timeline)
++ percentage = mpctx->sh_video->pts * 100 /
++ mpctx->timeline[mpctx->num_timeline_parts].start;
++ else
++ percentage = demuxer_get_percent_pos(mpctx->demuxer);
+
+ if (percentage >= 0)
+ snprintf(percentage_text, 9, " (%d%%)", percentage);
+@@ -1682,7 +1710,7 @@ static double written_audio_pts(struct MPContext *mpctx)
+ // to get the length in original units without speedup or slowdown
+ a_pts -= buffered_output * mpctx->opts.playback_speed / ao_data.bps;
+
+- return a_pts;
++ return a_pts + mpctx->video_offset;
+ }
+
+ // Return pts value corresponding to currently playing audio.
+@@ -2220,7 +2248,7 @@ static double update_video_nocorrect_pts(struct MPContext *mpctx,
+ #endif
+ if (decoded_frame) {
+ // These updates are done here for vf_expand OSD/subtitles
+- update_subtitles(sh_video, mpctx->d_sub, 0);
++ update_subtitles(sh_video, mpctx->d_sub, mpctx->video_offset, 0);
+ update_teletext(sh_video, mpctx->demuxer, 0);
+ update_osd_msg(mpctx);
+ current_module = "filter video";
+@@ -2252,6 +2280,8 @@ static double update_video(struct MPContext *mpctx, int *blit_frame)
+ unsigned char *packet = NULL;
+ bool hit_eof = false;
+ int in_size = ds_get_packet_pts(mpctx->d_video, &packet, &pts);
++ if (pts != MP_NOPTS_VALUE)
++ pts += mpctx->video_offset;
+ if (in_size < 0) {
+ // try to extract last frames in case of decoder lag
+ in_size = 0;
+@@ -2266,7 +2296,7 @@ static double update_video(struct MPContext *mpctx, int *blit_frame)
+ framedrop_type, pts);
+ if (decoded_frame) {
+ // These updates are done here for vf_expand OSD/subtitles
+- update_subtitles(sh_video, mpctx->d_sub, 0);
++ update_subtitles(sh_video, mpctx->d_sub, mpctx->video_offset, 0);
+ update_teletext(sh_video, mpctx->demuxer, 0);
+ update_osd_msg(mpctx);
+ current_module = "filter video";
+@@ -2459,6 +2489,48 @@ static void edl_update(MPContext *mpctx)
+ }
+ }
+
++static void reinit_decoders(struct MPContext *mpctx)
++{
++ reinit_video_chain(mpctx);
++ reinit_audio_chain(mpctx);
++ mp_property_do("sub", M_PROPERTY_SET, &mpctx->global_sub_pos, mpctx);
++}
++
++static bool timeline_set_part(struct MPContext *mpctx, int i)
++{
++ struct timeline_part *p = mpctx->timeline + mpctx->timeline_part;
++ struct timeline_part *n = mpctx->timeline + i;
++ mpctx->timeline_part = i;
++ mpctx->video_offset = n->start - n->source_start;
++ if (n->source == p->source)
++ return false;
++ uninit_player(mpctx, INITIALIZED_VCODEC | (mpctx->opts.fixed_vo && mpctx->opts.video_id != -2 ? 0 : INITIALIZED_VO) | INITIALIZED_AO | INITIALIZED_ACODEC);
++ mpctx->demuxer = n->source->demuxer;
++ mpctx->d_video = mpctx->demuxer->video;
++ mpctx->d_audio = mpctx->demuxer->audio;
++ mpctx->d_sub = mpctx->demuxer->sub;
++ mpctx->sh_video = mpctx->d_video->sh;
++ mpctx->sh_audio = mpctx->d_audio->sh;
++ return true;
++}
++
++// Given pts, switch playback to the corresponding part.
++// Return offset within that part.
++static double timeline_set_from_time(struct MPContext *mpctx, double pts,
++ bool *need_reset)
++{
++ if (pts < 0)
++ pts = 0;
++ for (int i = 0; i < mpctx->num_timeline_parts; i++) {
++ struct timeline_part *p = mpctx->timeline + i;
++ if (pts < (p+1)->start) {
++ *need_reset = timeline_set_part(mpctx, i);
++ return pts - p->start + p->source_start;
++ }
++ }
++ return -1;
++}
++
+
+ // style & SEEK_ABSOLUTE == 0 means seek relative to current position, == 1 means absolute
+ // style & SEEK_FACTOR == 0 means amount in seconds, == 2 means fraction of file length
+@@ -2466,7 +2538,13 @@ static void edl_update(MPContext *mpctx)
+ static int seek(MPContext *mpctx, double amount, int style)
+ {
+ current_module = "seek";
+- if (mpctx->demuxer->accurate_seek && mpctx->sh_video
++ if (mpctx->stop_play == AT_END_OF_FILE)
++ mpctx->stop_play = KEEP_PLAYING;
++ if (mpctx->timeline && style & SEEK_FACTOR) {
++ amount *= mpctx->timeline[mpctx->num_timeline_parts].start;
++ style &= ~SEEK_FACTOR;
++ }
++ if ((mpctx->demuxer->accurate_seek || mpctx->timeline) && mpctx->sh_video
+ && !(style & (SEEK_ABSOLUTE | SEEK_FACTOR))) {
+ style |= SEEK_ABSOLUTE;
+ if (amount > 0)
+@@ -2476,7 +2554,27 @@ static int seek(MPContext *mpctx, double amount, int style)
+ amount += mpctx->sh_video->pts;
+ }
+
+- if (demux_seek(mpctx->demuxer, amount, audio_delay, style) == 0)
++ /* At least the liba52 decoder wants to read from the input stream
++ * during initialization, so reinit must be done after the demux_seek()
++ * call that clears possible stream EOF. */
++ bool need_reset = false;
++ if (mpctx->timeline) {
++ amount = timeline_set_from_time(mpctx, amount, &need_reset);
++ if (amount == -1) {
++ mpctx->stop_play = AT_END_OF_FILE;
++ // Clear audio from current position
++ if (mpctx->sh_audio) {
++ mpctx->audio_out->reset();
++ mpctx->sh_audio->a_buffer_len = 0;
++ mpctx->sh_audio->a_out_buffer_len = 0;
++ }
++ return -1;
++ }
++ }
++ int seekresult = demux_seek(mpctx->demuxer, amount, audio_delay, style);
++ if (need_reset)
++ reinit_decoders(mpctx);
++ if (seekresult == 0)
+ return -1;
+
+ if (mpctx->sh_video) {
+@@ -2493,8 +2591,8 @@ static int seek(MPContext *mpctx, double amount, int style)
+ // Not all demuxers set d_video->pts during seek, so this value
+ // (which is used by at least vobsub and edl code below) may
+ // be completely wrong (probably 0).
+- mpctx->sh_video->pts = mpctx->d_video->pts;
+- update_subtitles(mpctx->sh_video, mpctx->d_sub, 1);
++ mpctx->sh_video->pts = mpctx->d_video->pts + mpctx->video_offset;
++ update_subtitles(mpctx->sh_video, mpctx->d_sub, mpctx->video_offset, 1);
+ update_teletext(mpctx->sh_video, mpctx->demuxer, 1);
+ }
+
+@@ -2520,6 +2618,177 @@ static int seek(MPContext *mpctx, double amount, int style)
+ return 0;
+ }
+
++static int find_ordered_chapter_sources(struct MPContext *mpctx,
++ struct content_source *sources,
++ int num_sources,
++ unsigned char uid_map[][16])
++{
++ int num_filenames = 0;
++ char **filenames = NULL;
++ if (num_sources > 1) {
++ mp_msg(MSGT_CPLAYER, MSGL_INFO, "This file references data from "
++ "other sources.\n");
++ if (mpctx->stream->type != STREAMTYPE_FILE) {
++ mp_msg(MSGT_CPLAYER, MSGL_WARN, "Playback source is not a "
++ "normal disk file. Will not search for related files.\n");
++ } else {
++ mp_msg(MSGT_CPLAYER, MSGL_INFO, "Will scan other files in the "
++ "same directory to find referenced sources.\n");
++ filenames = find_files(mpctx->demuxer->filename, ".mkv",
++ &num_filenames);
++ }
++ }
++
++ int num_left = num_sources - 1;
++ for (int i = 0; i < num_filenames && num_left > 0; i++) {
++ mp_msg(MSGT_CPLAYER, MSGL_INFO, "Checking file %s\n",
++ filename_recode(filenames[i]));
++ int format;
++ struct stream *s = open_stream(filenames[i], &mpctx->opts, &format);
++ if (!s)
++ continue;
++ struct demuxer *d = demux_open(&mpctx->opts, s, DEMUXER_TYPE_MATROSKA,
++ mpctx->opts.audio_id,
++ mpctx->opts.video_id,
++ mpctx->opts.sub_id, filenames[i]);
++ if (!d) {
++ free_stream(s);
++ continue;
++ }
++ if (d->file_format == DEMUXER_TYPE_MATROSKA) {
++ for (int i = 1; i < num_sources; i++) {
++ if (sources[i].demuxer)
++ continue;
++ if (!memcmp(uid_map[i], d->matroska_data.segment_uid, 16)) {
++ mp_msg(MSGT_CPLAYER, MSGL_INFO,"Match for source %d: %s\n",
++ i, filename_recode(d->filename));
++ sources[i].stream = s;
++ sources[i].demuxer = d;
++ num_left--;
++ goto match;
++ }
++ }
++ }
++ free_demuxer(d);
++ free_stream(s);
++ continue;
++ match:
++ ;
++ }
++ talloc_free(filenames);
++ if (num_left) {
++ mp_msg(MSGT_CPLAYER, MSGL_ERR, "Failed to find ordered chapter part!\n"
++ "There will be parts MISSING from the video!\n");
++ for (int i = 1, j = 1; i < num_sources; i++)
++ if (sources[i].demuxer) {
++ sources[j] = sources[i];
++ memcpy(uid_map[j], uid_map[i], 16);
++ j++;
++ }
++ }
++ return num_sources - num_left;
++}
++
++static void build_ordered_chapter_timeline(struct MPContext *mpctx)
++{
++ mp_msg(MSGT_CPLAYER, MSGL_INFO, "File uses ordered chapters, will build "
++ "edit timeline.\n");
++
++ struct demuxer *demuxer = mpctx->demuxer;
++ struct matroska_data *m = &demuxer->matroska_data;
++
++ struct content_source *sources = talloc_array_ptrtype(NULL, sources,
++ m->num_ordered_chapters);
++ sources[0].stream = mpctx->stream;
++ sources[0].demuxer = mpctx->demuxer;
++ unsigned char uid_map[m->num_ordered_chapters][16];
++ int num_sources = 1;
++ memcpy(uid_map[0], m->segment_uid, 16);
++
++ for (int i = 0; i < m->num_ordered_chapters; i++) {
++ struct matroska_chapter *c = m->ordered_chapters + i;
++ if (!c->has_segment_uid)
++ memcpy(c->segment_uid, m->segment_uid, 16);
++
++ for (int j = 0; j < num_sources; j++)
++ if (!memcmp(c->segment_uid, uid_map[j], 16))
++ goto found1;
++ memcpy(uid_map[num_sources], c->segment_uid, 16);
++ sources[num_sources] = (struct content_source){};
++ num_sources++;
++ found1:
++ ;
++ }
++
++ num_sources = find_ordered_chapter_sources(mpctx, sources, num_sources,
++ uid_map);
++
++
++ struct timeline_part *timeline = talloc_array_ptrtype(NULL, timeline,
++ m->num_ordered_chapters + 1);
++ uint64_t starttime = 0;
++ uint64_t missing_time = 0;
++ int part_count = 0;
++ for (int i = 0; i < m->num_ordered_chapters; i++) {
++ struct matroska_chapter *c = m->ordered_chapters + i;
++
++ int j;
++ for (j = 0; j < num_sources; j++) {
++ if (!memcmp(c->segment_uid, uid_map[j], 16))
++ goto found2;
++ }
++ missing_time += c->end - c->start;
++ continue;
++ found2:;
++ // Only add a separate part if the time or file actually changes
++ uint64_t prev_end = !part_count ? 0 : starttime
++ - timeline[part_count - 1].start
++ + timeline[part_count - 1].source_start;
++ if (part_count == 0 || c->start != prev_end
++ || sources + j != timeline[part_count - 1].source) {
++ timeline[part_count].source = sources + j;
++ timeline[part_count].start = starttime / 1000.;
++ timeline[part_count].source_start = c->start / 1000.;
++ part_count++;
++ }
++ starttime += c->end - c->start;
++ }
++ timeline[part_count].start = starttime / 1000.;
++
++ if (!part_count) {
++ // None of the parts come from the file itself???
++ talloc_free(sources);
++ talloc_free(timeline);
++ return;
++ }
++
++ mp_msg(MSGT_CPLAYER, MSGL_V, "Timeline contains %d parts from %d "
++ "sources. Total length %.3f seconds.\n", part_count, num_sources,
++ timeline[part_count].start);
++ if (missing_time)
++ mp_msg(MSGT_CPLAYER, MSGL_ERR, "There are %.3f seconds missing "
++ "from the timeline!\n", missing_time / 1000.);
++ mp_msg(MSGT_CPLAYER, MSGL_V, "Source files:\n");
++ for (int i = 0; i < num_sources; i++)
++ mp_msg(MSGT_CPLAYER, MSGL_V, "%d: %s\n", i,
++ filename_recode(sources[i].demuxer->filename));
++ mp_msg(MSGT_CPLAYER, MSGL_V, "Timeline parts: (number, start, "
++ "source_start, source):\n");
++ for (int i = 0; i < part_count; i++) {
++ struct timeline_part *p = timeline + i;
++ mp_msg(MSGT_CPLAYER, MSGL_V, "%3d %9.3f %9.3f %3td\n", i, p->start,
++ p->source_start, p->source - sources);
++ }
++ mp_msg(MSGT_CPLAYER, MSGL_V, "END %9.3f\n", timeline[part_count].start);
++ mpctx->sources = sources;
++ mpctx->num_sources = num_sources;
++ mpctx->timeline = timeline;
++ mpctx->num_timeline_parts = part_count;
++ mpctx->timeline_part = 0;
++ mpctx->video_offset = timeline[0].source_start;
++ mpctx->demuxer = timeline[0].source->demuxer;
++}
++
+
+ static int read_keys(void *ctx, int fd)
+ {
+@@ -3311,6 +3580,17 @@ if (mpctx->demuxer && mpctx->demuxer->type==DEMUXER_TYPE_PLAYLIST)
+
+ if(!mpctx->demuxer)
+ goto goto_next_file;
++
++ if (mpctx->demuxer->matroska_data.ordered_chapters)
++ build_ordered_chapter_timeline(mpctx);
++
++ if (!mpctx->sources) {
++ mpctx->sources = talloc_ptrtype(NULL, mpctx->sources);
++ *mpctx->sources = (struct content_source){.stream = mpctx->stream,
++ .demuxer = mpctx->demuxer};
++ mpctx->num_sources = 1;
++ }
++
+ if(dvd_chapter>1) {
+ float pts;
+ if (demuxer_seek_chapter(mpctx->demuxer, dvd_chapter-1, 1, &pts, NULL, NULL) >= 0 && pts > -1.0)
+@@ -3335,14 +3615,17 @@ if (mpctx->global_sub_size <= mpctx->global_sub_indices[SUB_SOURCE_DEMUX] + opts
+
+ #ifdef CONFIG_ASS
+ if (ass_enabled && ass_library) {
+- for (i = 0; i < mpctx->demuxer->num_attachments; ++i) {
+- demux_attachment_t* att = mpctx->demuxer->attachments + i;
+- if (extract_embedded_fonts &&
+- att->name && att->type && att->data && att->data_size &&
+- (strcmp(att->type, "application/x-truetype-font") == 0 ||
+- strcmp(att->type, "application/x-font") == 0))
+- ass_add_font(ass_library, att->name, att->data, att->data_size);
+- }
++ for (int j = 0; j < mpctx->num_sources; j++) {
++ struct demuxer *d = mpctx->sources[j].demuxer;
++ for (int i = 0; i < d->num_attachments; i++) {
++ struct demux_attachment *att = d->attachments + i;
++ if (extract_embedded_fonts
++ && att->name && att->type && att->data && att->data_size
++ && (strcmp(att->type, "application/x-truetype-font") == 0
++ || strcmp(att->type, "application/x-font") == 0))
++ ass_add_font(ass_library, att->name, att->data, att->data_size);
++ }
++ }
+ }
+ #endif
+
+@@ -3775,6 +4058,15 @@ if(!mpctx->sh_video) {
+ }
+ }
+ }
++ if (mpctx->timeline) {
++ struct timeline_part *next = mpctx->timeline + mpctx->timeline_part + 1;
++ if (mpctx->sh_video->pts >= next->start
++ || mpctx->stop_play == AT_END_OF_FILE
++ && mpctx->timeline_part + 1 < mpctx->num_timeline_parts) {
++ seek(mpctx, next->start, SEEK_ABSOLUTE);
++ continue;
++ }
++ }
+
+ // ==========================================================================
+
+diff --git a/osdep/findfiles.c b/osdep/findfiles.c
+new file mode 100644
+index 0000000..879f6d5
+--- /dev/null
++++ b/osdep/findfiles.c
+@@ -0,0 +1,97 @@
++/*
++ * This file is part of MPlayer.
++ *
++ * MPlayer is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * MPlayer is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License along
++ * with MPlayer; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++ */
++
++#include <dirent.h>
++#include <string.h>
++#include <stdlib.h>
++#include <assert.h>
++
++#include "talloc.h"
++
++#if defined(__MINGW32__) || defined(__CYGWIN__)
++static const char dir_separators[] = "/\\:";
++#else
++static const char dir_separators[] = "/";
++#endif
++
++char **find_files(const char *original_file, const char *suffix,
++ int *num_results_ptr)
++{
++ void *tmpmem = talloc_new(NULL);
++ char *fname = talloc_strdup(tmpmem, original_file);
++ char *basename = NULL;
++ char *next = fname;
++ while (1) {
++ next = strpbrk(next, dir_separators);
++ if (!next)
++ break;
++ basename = next++;
++ }
++ char *directory;
++ if (basename) {
++ directory = fname;
++ *basename++ = 0;
++ } else {
++ directory = ".";
++ basename = fname;
++ }
++
++
++ char **results = talloc_size(NULL, 0);
++ DIR *dp = opendir(directory);
++ struct dirent *ep;
++ char ***names_by_matchlen = talloc_array(tmpmem, char **,
++ strlen(basename) + 1);
++ memset(names_by_matchlen, 0, talloc_get_size(names_by_matchlen));
++ int num_results = 0;
++ while ((ep = readdir(dp))) {
++ int suffix_offset = strlen(ep->d_name) - strlen(suffix);
++ // name must end with suffix
++ if (suffix_offset < 0 || strcmp(ep->d_name + suffix_offset, suffix))
++ continue;
++ // don't list the original name
++ if (!strcmp(ep->d_name, basename))
++ continue;
++
++ char *name = talloc_asprintf(results, "%s/%s", directory, ep->d_name);
++ char *s1 = ep->d_name;
++ char *s2 = basename;
++ int matchlen = 0;
++ while (*s1 && *s1++ == *s2++)
++ matchlen++;
++ int oldcount = talloc_get_size(names_by_matchlen[matchlen]) /
++ sizeof(char **);
++ names_by_matchlen[matchlen] = talloc_realloc(names_by_matchlen,
++ names_by_matchlen[matchlen],
++ char *, oldcount + 1);
++ names_by_matchlen[matchlen][oldcount] = name;
++ num_results++;
++ }
++ closedir(dp);
++ results = talloc_realloc(NULL, results, char *, num_results);
++ char **resptr = results;
++ for (int i = strlen(basename); i >= 0; i--) {
++ char **p = names_by_matchlen[i];
++ for (int j = 0; j < talloc_get_size(p) / sizeof(char *); j++)
++ *resptr++ = p[j];
++ }
++ assert(resptr == results + num_results);
++ talloc_free(tmpmem);
++ *num_results_ptr = num_results;
++ return results;
++}
+diff --git a/osdep/findfiles.h b/osdep/findfiles.h
+new file mode 100644
+index 0000000..97443e7
+--- /dev/null
++++ b/osdep/findfiles.h
+@@ -0,0 +1,2 @@
++char **find_files(const char *original_file, const char *suffix,
++ int *num_results_ptr);
+--
+1.6.5.GIT
+
diff --git a/media-sound/mplayer/files/extra/mplayer-stereoscopic-1.1.patch b/media-sound/mplayer/files/extra/mplayer-stereoscopic-1.1.patch
new file mode 100644
index 0000000..99fe35e
--- /dev/null
+++ b/media-sound/mplayer/files/extra/mplayer-stereoscopic-1.1.patch
@@ -0,0 +1,261 @@
+Patches (against MPlayer CVS of 8 Nov 2007) to allow mplayer
+to play stereo in a high-resolution quadbuffered OpenGL window,
+using the "gl2" video driver.
+Adapted from Gabriel A. v. Winckler's "gl" patch in
+ http://www.itdp.de/mplayer-dev-eng/2005-06/msg00361.html
+
+The advantage of this over Winckler's 2005 patch is that
+it works with the "gl2" driver (as opposed to "gl").
+gl2 breaks the image into multiple texture tiles, and allows
+playing movies which are larger than the graphics card's texture limit.
+
+I know this code isn't quite right -- in order to get the
+window sized properly, you have to explicitly specify the "-x" and "-y"
+options. Otherwise it does something screwy -- I'm not sure what,
+but the fact that the source movie is twice as wide as normal confuses
+the default window sizing logic, and I don't understand how to fix it.
+Hope someone who understands mplayer can.
+
+Anyway, typical usage on a 1920x1080 stereo display might be:
+
+ mplayer -vo gl2:stereo -x 3840 -y 1072 file.mpeg
+
+Note the -vo argument starts with lowercase GL2, not g twelve!
+
+Each 3840x1072 frame of the MPEG was the result of
+gluing two 1920x1072 left- and right-eye images side by side.
+
+
+ Stuart Levy, slevy@ncsa.uiuc.edu, March (and November), 2007
+
+2009 some changes to the gl2 driver were performed. I modified the patch
+to apply over mplayer-1.0_rc4_p20091026-r1.
+
+ Jürgen Löb, jloeb@main-host.de, January 2010
+
+I modified the patch to apply over mplayer-1.1-r1.
+
+ Wojciech Myrda, vojcek@tlen.pl, July 2012
+
+--- libvo/vo_gl2.c.orig 2007-11-08 16:04:39.841811388 -0600
++++ libvo/vo_gl2.c 2007-11-16 19:24:06.415341836 -0600
+@@ -23,6 +23,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <math.h>
+
+ #include "config.h"
+ #include "mp_msg.h"
+@@ -60,6 +61,9 @@
+ /* local data */
+ static unsigned char *ImageData=NULL;
+
++// QuadBuffer Stereo
++static unsigned char quadbuffer_stereo = 0;
++
+ static MPGLContext glctx;
+
+ static uint32_t image_width;
+@@ -377,23 +383,31 @@
+ }
+
+
+-static void drawTextureDisplay (void)
++static void drawTextureDisplay ( float tex0, float tex1 )
+ {
+ struct TexSquare *square = texgrid;
+ int x, y;
++ int itx0, itx1;
++ GLfloat fxoff = tex0;
++ GLfloat fxscale = 1.0f / (tex1 - tex0);
++
+
+ glColor4f(1.0,1.0,1.0,1.0);
+
++ itx0 = (int) (tex0 * texnumx);
++ itx1 = (int) ceilf(tex1 * texnumx);
++
+ if (is_yuv)
+ glEnableYUVConversion(GL_TEXTURE_2D, use_yuv);
+ for (y = 0; y < texnumy; y++) {
+ int thish = texture_height;
+ if (y == texnumy - 1 && image_height % texture_height)
+ thish = image_height % texture_height;
+- for (x = 0; x < texnumx; x++) {
++ for (x = itx0; x < itx1; x++) {
+ int thisw = texture_width;
+ if (x == texnumx - 1 && image_width % texture_width)
+ thisw = image_width % texture_width;
++ square = texgrid + y*texnumx + x;
+ glBindTexture (GL_TEXTURE_2D, square->texobj);
+ if (is_yuv) {
+ mpglActiveTexture(GL_TEXTURE1);
+@@ -409,11 +423,10 @@
+ 0, 0, thisw, thish, 0);
+ }
+
+- glDrawTex(square->fx, square->fy, square->fw, square->fh,
++ glDrawTex((square->fx - fxoff) * fxscale, square->fy, square->fw * fxscale, square->fh,
+ 0, 0, texture_width, texture_height,
+ texture_width, texture_height,
+ 0, is_yuv, 0);
+- square++;
+ } /* for all texnumx */
+ } /* for all texnumy */
+ if (is_yuv)
+@@ -432,6 +435,8 @@
+ };
+ mp_msg(MSGT_VO,MSGL_V,"[gl2] Resize: %dx%d\n",x,y);
+ if(aspect_scaling()) {
++ if ( quadbuffer_stereo )
++ glDrawBuffer(GL_BACK);
+ glClear(GL_COLOR_BUFFER_BIT);
+ aspect(&x, &y, A_WINZOOM);
+ panscan_calc_windowed();
+@@ -458,18 +473,26 @@
+
+ static void draw_alpha_32(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
+ vo_draw_alpha_rgb32(w,h,src,srca,stride,ImageData+4*(y0*image_width+x0),4*image_width);
++ if (quadbuffer_stereo)
++ vo_draw_alpha_rgb32(w,h,src,srca,stride,ImageData+4*(y0*image_width+x0+image_width/2),4*image_width);
+ }
+
+ static void draw_alpha_24(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
+ vo_draw_alpha_rgb24(w,h,src,srca,stride,ImageData+3*(y0*image_width+x0),3*image_width);
++ if (quadbuffer_stereo)
++ vo_draw_alpha_rgb24(w,h,src,srca,stride,ImageData+3*(y0*image_width+x0+image_width/2),3*image_width);
+ }
+
+ static void draw_alpha_16(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
+ vo_draw_alpha_rgb16(w,h,src,srca,stride,ImageData+2*(y0*image_width+x0),2*image_width);
++ if (quadbuffer_stereo)
++ vo_draw_alpha_rgb16(w,h,src,srca,stride,ImageData+2*(y0*image_width+x0+image_width/2),2*image_width);
+ }
+
+ static void draw_alpha_15(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
+ vo_draw_alpha_rgb15(w,h,src,srca,stride,ImageData+2*(y0*image_width+x0),2*image_width);
++ if (quadbuffer_stereo)
++ vo_draw_alpha_rgb15(w,h,src,srca,stride,ImageData+2*(y0*image_width+x0+image_width/2),2*image_width);
+ }
+
+ static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
+@@ -507,6 +530,11 @@
+ /* furthermore it must be RGBA (not color indexed) ... */
+ res = glXGetConfig(dpy, vi_list + i, GLX_RGBA, &val);
+ if (res || val == False) continue;
++ /* assure quadbuffered stereo if requested */
++ if (quadbuffer_stereo) {
++ res = glXGetConfig(dpy, vi_list + i, GLX_STEREO, &val);
++ if (res || val == False) continue;
++ }
+ /* prefer less depth buffer size, */
+ res = glXGetConfig(dpy, vi_list + i, GLX_DEPTH_SIZE, &val);
+ if (res) continue;
+@@ -547,7 +575,10 @@
+ XVisualInfo *vinfo, vinfo_buf;
+ vinfo = choose_glx_visual(mDisplay,mScreen,&vinfo_buf) < 0 ? NULL : &vinfo_buf;
+ if (vinfo == NULL) {
+- mp_msg(MSGT_VO, MSGL_FATAL, "[gl2] no GLX support present\n");
++ if (quadbuffer_stereo)
++ mp_msg(MSGT_VO, MSGL_FATAL, "[gl2] no Quadbuffered Stereo GLX support present\n");
++ else
++ mp_msg(MSGT_VO, MSGL_FATAL, "[gl2] no GLX support present\n");
+ return -1;
+ }
+
+@@ -609,9 +640,18 @@
+ resize(d_width, d_height);
+
+ glClearColor( 0.0f,0.0f,0.0f,0.0f );
+- glClear( GL_COLOR_BUFFER_BIT );
+-
+- drawTextureDisplay ();
++ if ( quadbuffer_stereo ) {
++ glDrawBuffer(GL_BACK);
++ glClear( GL_COLOR_BUFFER_BIT );
++ glDrawBuffer(GL_BACK_LEFT);
++ drawTextureDisplay( 0.0f, 0.5f );
++ glDrawBuffer(GL_BACK_RIGHT);
++ drawTextureDisplay( 0.5f, 1.0f );
++
++ } else {
++ glClear( GL_COLOR_BUFFER_BIT );
++ drawTextureDisplay ( 0.0f, 1.0f );
++ }
+
+ return 0;
+ }
+@@ -630,6 +670,20 @@
+ image_format = format;
+ is_yuv = mp_get_chroma_shift(image_format, &xs, &ys, NULL) > 0;
+ is_yuv |= (xs << 8) | (ys << 16);
++#if 0
++ if (quadbuffer_stereo) {
++ /* v. Winckler's patch had just d_width /= 2, but that doesn't seem right either.
++ * Mplayer experts please help! Meanwhile, leave this section out.
++ * Then users must still give explicit -x and -y options as in
++ * mplayer -vo gl2:stereo -x <SCREENWIDTH> -y <SCREENHEIGHT> movie...
++ * At least *that* works. But default window doesn't, nor does -fs,
++ * both apparently confused by double-wide aspect ratio of stereo anim files.
++ */
++ width /= 2;
++ d_width /= 2;
++ }
++#endif
++
+
+ int_pause = 0;
+
+@@ -730,21 +784,31 @@
+ static void draw_osd(void)
+ {
+ if (ImageData)
+- vo_draw_text(image_width,image_height,draw_alpha_fnc);
++ vo_draw_text( quadbuffer_stereo ? image_width/2 : image_width, image_height,draw_alpha_fnc);
+ }
+
+ static void
+ flip_page(void)
+ {
+- drawTextureDisplay();
++ if ( quadbuffer_stereo ) {
++ glDrawBuffer( GL_BACK_LEFT );
++ drawTextureDisplay( 0.0f, 0.5f );
++ glDrawBuffer( GL_BACK_RIGHT );
++ drawTextureDisplay( 0.5f, 1.0f );
++ } else {
++ drawTextureDisplay( 0.0f, 1.0f );
++ }
+
+ // glFlush();
+ if (use_glFinish)
+- glFinish();
++ glFinish();
+ glctx.swapGlBuffers(&glctx);
+
+ if (aspect_scaling()) // Avoid flickering borders in fullscreen mode
++ {
++ if ( quadbuffer_stereo ) glDrawBuffer(GL_BACK);
+ glClear (GL_COLOR_BUFFER_BIT);
++ }
+ }
+
+ static int draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y)
+@@ -849,6 +913,7 @@
+ static const opt_t subopts[] = {
+ {"yuv", OPT_ARG_INT, &use_yuv, int_non_neg},
+ {"glfinish", OPT_ARG_BOOL, &use_glFinish, NULL},
++ {"stereo", OPT_ARG_BOOL, &quadbuffer_stereo, NULL},
+ {NULL}
+ };
+
+@@ -875,6 +940,8 @@
+ " 3: use fragment program with gamma correction.\n"
+ " 4: use fragment program with gamma correction via lookup.\n"
+ " 5: use ATI-specific method (for older cards).\n"
++ " stereo\n"
++ " use quadbuffered stereo: left-half image to left eye, etc.\n"
+ "\n" );
+ return -1;
+ }
diff --git a/media-sound/mplayer/files/extra/mplayer-vaapi-1.1.patch b/media-sound/mplayer/files/extra/mplayer-vaapi-1.1.patch
new file mode 100644
index 0000000..f810b31
--- /dev/null
+++ b/media-sound/mplayer/files/extra/mplayer-vaapi-1.1.patch
@@ -0,0 +1,3883 @@
+diff -Naur mplayer-1.0_rc4_p20120109/cfg-common.h mplayer-1.0_rc4_p20120109-new/cfg-common.h
+--- mplayer-1.0_rc4_p20120109/cfg-common.h 2012-01-09 14:47:06.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/cfg-common.h 2012-01-16 15:51:41.000000000 +0100
+@@ -524,6 +524,7 @@
+ {"vfm", &video_fm_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
+ {"ac", &audio_codec_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
+ {"vc", &video_codec_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
++ {"va", &video_hwaccel_name, CONF_TYPE_STRING, 0, 0, 0, NULL},
+
+ // postprocessing:
+ #ifdef CONFIG_POSTPROC
+diff -Naur mplayer-1.0_rc4_p20120109/codec-cfg.c mplayer-1.0_rc4_p20120109-new/codec-cfg.c
+--- mplayer-1.0_rc4_p20120109/codec-cfg.c 2012-01-09 14:46:49.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/codec-cfg.c 2012-01-16 15:51:41.000000000 +0100
+@@ -238,6 +238,13 @@
+ {"VDPAU_VC1", IMGFMT_VDPAU_VC1},
+ {"VDPAU_MPEG4", IMGFMT_VDPAU_MPEG4},
+
++ {"VAAPI_MPEG2", IMGFMT_VAAPI_MPEG2},
++ {"VAAPI_MPEG4", IMGFMT_VAAPI_MPEG4},
++ {"VAAPI_H263", IMGFMT_VAAPI_H263},
++ {"VAAPI_H264", IMGFMT_VAAPI_H264},
++ {"VAAPI_WMV3", IMGFMT_VAAPI_WMV3},
++ {"VAAPI_VC1", IMGFMT_VAAPI_VC1},
++
+ {NULL, 0}
+ };
+
+diff -Naur mplayer-1.0_rc4_p20120109/configure mplayer-1.0_rc4_p20120109-new/configure
+--- mplayer-1.0_rc4_p20120109/configure 2012-01-09 14:46:57.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/configure 2012-01-16 15:51:41.000000000 +0100
+@@ -50,12 +50,13 @@
+ 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
++ if ! git clone 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
++ ffrevision=fc09bf57a60d4c4a6d339b204b3282337067c06d
++ cd ffmpeg && git checkout $ffrevision && cd ..
+ fi
+
+ # Prevent locale nonsense from breaking basic text processing utilities
+@@ -471,6 +473,9 @@
+ --disable-muxer=MUXER disable specified FFmpeg muxer
+ --enable-muxer=MUXER enable specified FFmpeg muxer
+
++Hardware acceleration:
++ --enable-vaapi enable VA-API acceleration [disable]
++
+ Video output:
+ --disable-vidix disable VIDIX [for x86 *nix]
+ --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
+@@ -500,6 +505,7 @@
+ --enable-dvb enable DVB video output [autodetect]
+ --enable-mga enable mga_vid video output [autodetect]
+ --enable-xmga enable mga_vid X11 video output [autodetect]
++ --enable-xrender enable Xrender video output [autodetect]
+ --enable-xv enable Xv video output [autodetect]
+ --enable-xvmc enable XvMC acceleration [disable]
+ --enable-vdpau enable VDPAU acceleration [autodetect]
+@@ -607,6 +613,7 @@
+ --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
+ --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
+
++ --with-vaapi-prefix=PATH prefix to VA-API include and lib directories
+ --with-freetype-config=PATH path to freetype-config
+ --with-glib-config=PATH path to glib*-config
+ --with-gtk-config=PATH path to gtk*-config
+@@ -674,8 +681,7 @@
+ libavbsfs_all=$(sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
+ libavbsfs=$libavbsfs_all
+ libavhwaccels_all=$(sed -n 's/^[^#]*HWACCEL.*(.*, *\(.*\)).*/\1_hwaccel/p' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
+-# Disable all hardware accelerators for now.
+-libavhwaccels=
++libavhwaccels=$(for h in $libavhwaccels_all; do case $h in (*_VAAPI_HWACCEL) echo $h;; esac; done)
+ 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]')
+@@ -687,11 +693,15 @@
+ libavfilters=$(echo $libavfilters_all | sed -e 's/ LIB[A-Z0-9_]*_FILTER//g' -e 's/ FREI0R[A-Z0-9_]*_FILTER//g' -e 's/ OCV_FILTER//g' -e 's/ MP_FILTER//g')
+ _mencoder=yes
+ _mplayer=yes
++_vaapi=auto
++_vaapi_glx=no
++_libgtop=auto
+ _x11=auto
+ _xshape=auto
+ _xss=auto
+ _dga1=auto
+ _dga2=auto
++_xrender=auto
+ _xv=auto
+ _xvmc=no #auto when complete
+ _vdpau=auto
+@@ -916,6 +927,9 @@
+ _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
+ ;;
+
++ --with-vaapi-prefix=*)
++ _vaapiprefix=$(echo $ac_option | cut -d '=' -f 2)
++ ;;
+ --with-sdl-config=*)
+ _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
+ ;;
+@@ -1031,10 +1045,14 @@
+ --disable-xshape) _xshape=no ;;
+ --enable-xss) _xss=yes ;;
+ --disable-xss) _xss=no ;;
++ --enable-xrender) _xrender=yes ;;
++ --disable-xrender) _xrender=no ;;
+ --enable-xv) _xv=yes ;;
+ --disable-xv) _xv=no ;;
+ --enable-xvmc) _xvmc=yes ;;
+ --disable-xvmc) _xvmc=no ;;
++ --enable-vaapi) _vaapi=yes ;;
++ --disable-vaapi) _vaapi=no ;;
+ --enable-vdpau) _vdpau=yes ;;
+ --disable-vdpau) _vdpau=no ;;
+ --enable-sdl) _sdl=yes ;;
+@@ -1129,6 +1147,8 @@
+ --disable-twolame) _twolame=no ;;
+ --enable-libcdio) _libcdio=yes ;;
+ --disable-libcdio) _libcdio=no ;;
++ --enable-libgtop) _libgtop=yes ;;
++ --disable-libgtop) _libgtop=no ;;
+ --enable-liblzo) _liblzo=yes ;;
+ --disable-liblzo) _liblzo=no ;;
+ --enable-libvorbis) _libvorbis=yes ;;
+@@ -3942,6 +3979,28 @@
+ echores "$gettimeofday"
+
+
++echocheck "clock_gettime()"
++cat > $TMPC << EOF
++#include <time.h>
++int main(void) {
++ struct timespec t;
++ clock_gettime(CLOCK_REALTIME, &t);
++ return 0;
++}
++EOF
++_clock_gettime=no
++cc_check -lrt && _clock_gettime=yes
++if test "$_clock_gettime" = yes ; then
++ def_clock_gettime='#define HAVE_CLOCK_GETTIME 1'
++ extra_ldflags="$extra_ldflags -lrt"
++ _need_clock_gettime=no
++else
++ def_clock_gettime='#undef HAVE_CLOCK_GETTIME'
++ _need_clock_gettime=yes
++fi
++echores "$_clock_gettime"
++
++
+ echocheck "glob()"
+ # glob_win disables a Windows-specific glob() replacement.
+ glob=yes
+@@ -4350,6 +4409,30 @@
+ fi
+
+
++echocheck "Xrender"
++if test "$_xrender" = auto ; then
++ cat > $TMPC <<EOF
++#include <X11/Xlib.h>
++#include <X11/extensions/Xrender.h>
++int main(void) {
++ (void) XRenderCreatePicture(0, 0, 0, 0, 0);
++ return 0; }
++EOF
++ _xrender=no
++ cc_check -lXrender && _xrender=yes
++fi
++
++if test "$_xrender" = yes ; then
++ def_xrender='#define CONFIG_XRENDER 1'
++ libs_mplayer="$libs_mplayer -lXrender"
++ vomodules="xrender $vomodules"
++else
++ def_xrender='#undef CONFIG_XRENDER'
++ novomodules="xrender $novomodules"
++fi
++echores "$_xrender"
++
++
+ echocheck "Xv"
+ if test "$_xv" = auto && test "$_x11" = yes ; then
+ _xv=no
+@@ -4830,6 +4912,31 @@
+ fi #if darwin
+
+
++echocheck "libgtop"
++if test "$_libgtop" = auto ; then
++ _libgtop=no
++ if $_pkg_config --exists 'libgtop-2.0' ; then
++
++cat > $TMPC << EOF
++#include <glibtop/cpu.h>
++#include <glibtop/proctime.h>
++int main(void) { return 0; }
++EOF
++cc_check $($_pkg_config --libs --cflags libgtop-2.0) && tmp_run && _libgtop=yes
++
++ fi
++fi
++echores "$_libgtop"
++
++if test "$_libgtop" = yes ; then
++ def_libgtop='#define CONFIG_LIBGTOP 1'
++ libs_mplayer="$libs_mplayer $($_pkg_config --libs libgtop-2.0)"
++ extra_cflags="$extra_cflags $($_pkg_config --cflags libgtop-2.0)"
++else
++ def_libgtop='#define CONFIG_LIBGTOP 0'
++fi
++
++
+ echocheck "PNG support"
+ if test "$_png" = auto ; then
+ _png=no
+@@ -5210,6 +5317,23 @@
+ fi
+ echores "$_gl"
+
++echocheck "OpenGL utilities (GLU)"
++_glu=no
++if test "$_gl" = yes; then
++ cat > $TMPC << EOF
++#include <GL/glu.h>
++int main(void) {
++ gluPerspective(0.0, 0.0, 0.0, 0.0);
++ return 0;
++}
++EOF
++ cc_check -lGLU && _glu=yes
++fi
++if test "$_glu" = yes; then
++ libs_mplayer="$libs_mplayer -lGLU"
++fi
++echores "$_glu"
++
+
+ echocheck "MatrixView"
+ if test "$matrixview" = auto ; then
+@@ -5685,6 +5799,57 @@
+ fi #if os2
+
+
++#########################
++# HARDWARE ACCELERATORS #
++#########################
++
++echocheck "VA-API"
++if test -n "$_vaapiprefix"; then
++ _vaapiinc="-I$_vaapiprefix/include"
++ _vaapilib="-L$_vaapiprefix/lib"
++fi
++if test "$_vaapi" = yes -o "$_vaapi" = auto; then
++ _vaapi=no
++ cat > $TMPC <<EOF
++#include <va/va_x11.h>
++int main(void) { (void) vaGetDisplay(0); return 0; }
++EOF
++ cc_check $_vaapiinc $_vaapilib -lva-x11 -lva && _vaapi=yes
++fi
++
++if test "$_vaapi" = yes ; then
++ def_vaapi='#define CONFIG_VAAPI 1'
++ extra_cflags="$extra_cflags $_vaapiinc"
++ libs_mencoder="$libs_mencoder $_vaapilib -lva"
++ libs_mplayer="$libs_mplayer $_vaapilib -lva-x11 -lva"
++ vomodules="vaapi $vomodules"
++else
++ def_vaapi='#define CONFIG_VAAPI 0'
++ novomodules="vaapi $novomodules"
++ libavhwaccels=`echo $libavhwaccels | sed -e "s/\(MPEG[124]\|H26[34]\|WMV3\|VC1\)_VAAPI_HWACCEL//g"`
++fi
++echores "$_vaapi"
++
++echocheck "VA-API (with GLX support)"
++if test "$_vaapi" = yes; then
++ _vaapi_glx=no
++ if test "$_gl" = "yes" -a "$_glu" = yes; then
++ cat > $TMPC <<EOF
++#include <va/va_glx.h>
++int main(void) { (void) vaGetDisplayGLX(0); return 0; }
++EOF
++ cc_check $_vaapiinc $_vaapilib -lva-glx -lva && _vaapi_glx=yes
++ fi
++fi
++if test "$_vaapi_glx" = yes; then
++ def_vaapi_glx='#define CONFIG_VAAPI_GLX 1'
++ libs_mplayer="$libs_mplayer -lva-glx -lva"
++else
++ def_vaapi_glx='#define CONFIG_VAAPI_GLX 0'
++fi
++echores "$_vaapi_glx"
++
++
+ # set default CD/DVD devices
+ if win32 || os2 ; then
+ default_cdrom_device="D:"
+@@ -8186,6 +8365,7 @@
+ TWOLAME=$_twolame
+ UNRAR_EXEC = $_unrar_exec
+ V4L2 = $_v4l2
++VAAPI = $_vaapi
+ VCD = $_vcd
+ VDPAU = $_vdpau
+ VESA = $_vesa
+@@ -8294,8 +8470,10 @@
+ CONFIG_MUXERS = yes
+ CONFIG_NETWORK = $networking
+ CONFIG_RTPDEC = $networking
++CONFIG_VAAPI = $_vaapi
+ CONFIG_VF_LAVFI = $_vf_lavfi
+ CONFIG_VDPAU = $_vdpau
++CONFIG_XRENDER = $_xrender
+ CONFIG_XVMC = $_xvmc
+ CONFIG_ZLIB = $_zlib
+
+@@ -8411,6 +8590,7 @@
+
+
+ /* system functions */
++$def_clock_gettime
+ $def_gethostbyname2
+ $def_gettimeofday
+ $def_glob
+@@ -8440,6 +8620,7 @@
+ $def_extern_prefix
+ $def_iconv
+ $def_kstat
++$def_libgtop
+ $def_macosx_bundle
+ $def_macosx_finder
+ $def_maemo
+@@ -8669,6 +8850,8 @@
+ $def_tdfxvid
+ $def_tga
+ $def_v4l2
++$def_vaapi
++$def_vaapi_glx
+ $def_vdpau
+ $def_vesa
+ $def_vidix
+@@ -8694,6 +8877,7 @@
+ $def_xinerama
+ $def_xmga
+ $def_xss
++$def_xrender
+ $def_xv
+ $def_xvmc
+ $def_xvr100
+diff -Naur mplayer-1.0_rc4_p20120109/etc/codecs.conf mplayer-1.0_rc4_p20120109-new/etc/codecs.conf
+--- mplayer-1.0_rc4_p20120109/etc/codecs.conf 2012-01-09 14:47:11.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/etc/codecs.conf 2012-01-16 15:51:41.000000000 +0100
+@@ -344,6 +345,7 @@
+ fourcc slif ; SoftLab MPEG-2 I-frames Codec
+ driver ffmpeg
+ dll "mpeg2video"
++ out VAAPI_MPEG2
+ out YV12,I420,IYUV
+ out 422P,444P
+ out IDCT_MPEG2
+@@ -1144,6 +1146,7 @@
+ fourcc WMV3,wmv3
+ driver ffmpeg
+ dll wmv3
++ out VAAPI_WMV3
+ out YV12,I420,IYUV
+
+ videocodec ffwvp2
+@@ -1185,6 +1188,7 @@
+ fourcc vc-1,VC-1
+ driver ffmpeg
+ dll vc1
++ out VAAPI_VC1
+ out YV12,I420,IYUV
+
+ videocodec ffvc1vdpau
+@@ -1226,6 +1230,7 @@
+ out 422P,422P10
+ out 444P,444P9,444P10
+ out GBR24P
++ out VAAPI_H264
+
+ videocodec ffh264vdpau
+ info "FFmpeg H.264 (VDPAU)"
+@@ -1326,6 +1312,7 @@
+ fourcc QMP4,HV60
+ driver ffmpeg
+ dll mpeg4 ;opendivx
++ out VAAPI_MPEG4
+ out YV12,I420,IYUV
+
+ videocodec ffodivxvdpau
+@@ -1977,6 +1984,7 @@
+ fourcc VX1K ; Agora Labs VX1000S H263
+ driver ffmpeg
+ dll h263
++ out VAAPI_H263
+ out YV12,I420,IYUV
+
+ videocodec ffzygo
+diff -Naur mplayer-1.0_rc4_p20120109/fmt-conversion.c mplayer-1.0_rc4_p20120109-new/fmt-conversion.c
+--- mplayer-1.0_rc4_p20120109/fmt-conversion.c 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/fmt-conversion.c 2012-01-16 15:51:41.000000000 +0100
+@@ -18,6 +18,7 @@
+
+ #include "mp_msg.h"
+ #include "libavutil/avutil.h"
++#include "libavcodec/avcodec.h"
+ #include "libmpcodecs/img_format.h"
+ #include "libavutil/pixfmt.h"
+ #include "libavutil/samplefmt.h"
+@@ -27,6 +28,7 @@
+ static const struct {
+ int fmt;
+ enum PixelFormat pix_fmt;
++ enum CodecID codec_id;
+ } conversion_map[] = {
+ {IMGFMT_ARGB, PIX_FMT_ARGB},
+ {IMGFMT_BGRA, PIX_FMT_BGRA},
+@@ -128,6 +130,17 @@
+ {IMGFMT_VDPAU_WMV3, PIX_FMT_VDPAU_WMV3},
+ {IMGFMT_VDPAU_VC1, PIX_FMT_VDPAU_VC1},
+ {IMGFMT_VDPAU_MPEG4, PIX_FMT_VDPAU_MPEG4},
++
++ /* VA-API formats */
++ {IMGFMT_VAAPI_MPEG2, PIX_FMT_VAAPI_VLD, CODEC_ID_MPEG2VIDEO},
++ {IMGFMT_VAAPI_MPEG2_IDCT,PIX_FMT_VAAPI_IDCT, CODEC_ID_MPEG2VIDEO},
++ {IMGFMT_VAAPI_MPEG2_MOCO,PIX_FMT_VAAPI_MOCO, CODEC_ID_MPEG2VIDEO},
++ {IMGFMT_VAAPI_MPEG4, PIX_FMT_VAAPI_VLD, CODEC_ID_MPEG4},
++ {IMGFMT_VAAPI_H263, PIX_FMT_VAAPI_VLD, CODEC_ID_H263},
++ {IMGFMT_VAAPI_H264, PIX_FMT_VAAPI_VLD, CODEC_ID_H264},
++ {IMGFMT_VAAPI_WMV3, PIX_FMT_VAAPI_VLD, CODEC_ID_WMV3},
++ {IMGFMT_VAAPI_VC1, PIX_FMT_VAAPI_VLD, CODEC_ID_VC1},
++
+ {0, PIX_FMT_NONE}
+ };
+
+@@ -144,12 +157,14 @@
+ return pix_fmt;
+ }
+
+-int pixfmt2imgfmt(enum PixelFormat pix_fmt)
++int pixfmt2imgfmt(enum PixelFormat pix_fmt, int codec_id)
+ {
+ int i;
+ int fmt;
+ for (i = 0; conversion_map[i].pix_fmt != PIX_FMT_NONE; i++)
+- if (conversion_map[i].pix_fmt == pix_fmt)
++ if (conversion_map[i].pix_fmt == pix_fmt &&
++ (conversion_map[i].codec_id == 0 ||
++ conversion_map[i].codec_id == codec_id))
+ break;
+ fmt = conversion_map[i].fmt;
+ if (!fmt)
+diff -Naur mplayer-1.0_rc4_p20120109/fmt-conversion.h mplayer-1.0_rc4_p20120109-new/fmt-conversion.h
+--- mplayer-1.0_rc4_p20120109/fmt-conversion.h 2012-01-09 14:46:49.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/fmt-conversion.h 2012-01-16 15:51:41.000000000 +0100
+@@ -24,7 +24,7 @@
+ #include "libavutil/samplefmt.h"
+
+ enum PixelFormat imgfmt2pixfmt(int fmt);
+-int pixfmt2imgfmt(enum PixelFormat pix_fmt);
++int pixfmt2imgfmt(enum PixelFormat pix_fmt, int codec_id);
+ enum AVSampleFormat affmt2samplefmt(int fmt);
+ int samplefmt2affmt(enum AVSampleFormat sample_fmt);
+
+diff -Naur mplayer-1.0_rc4_p20120109/help/help_mp-en.h mplayer-1.0_rc4_p20120109-new/help/help_mp-en.h
+--- mplayer-1.0_rc4_p20120109/help/help_mp-en.h 2012-01-09 14:47:08.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/help/help_mp-en.h 2012-01-16 15:51:41.000000000 +0100
+@@ -754,6 +754,7 @@
+ #define MSGTR_PREFERENCES_IDX "Rebuild index table, if needed"
+ #define MSGTR_PREFERENCES_VideoCodecFamily "Video codec family:"
+ #define MSGTR_PREFERENCES_AudioCodecFamily "Audio codec family:"
++#define MSGTR_PREFERENCES_VideoHardwareAcceleration "Video hardware acceleration:"
+ #define MSGTR_PREFERENCES_FRAME_OSD_Level "OSD level"
+ #define MSGTR_PREFERENCES_FRAME_Subtitle "Subtitle"
+ #define MSGTR_PREFERENCES_FRAME_Font "Font"
+@@ -1659,6 +1660,7 @@
+ #define MSGTR_MPCODECS_UnexpectedInitVoError "[VD_FFMPEG] Unexpected init_vo error.\n"
+ #define MSGTR_MPCODECS_UnrecoverableErrorRenderBuffersNotTaken "[VD_FFMPEG] Unrecoverable error, render buffers not taken.\n"
+ #define MSGTR_MPCODECS_OnlyBuffersAllocatedByVoXvmcAllowed "[VD_FFMPEG] Only buffers allocated by vo_xvmc allowed.\n"
++#define MSGTR_MPCODECS_VAAPIAcceleratedCodec "[VD_FFMPEG] VA API accelerated codec.\n"
+
+ // libmpcodecs/ve_lavc.c
+ #define MSGTR_MPCODECS_HighQualityEncodingSelected "[VE_LAVC] High quality encoding selected (non-realtime)!\n"
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/dec_video.c mplayer-1.0_rc4_p20120109-new/libmpcodecs/dec_video.c
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/dec_video.c 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/dec_video.c 2012-01-16 15:51:41.000000000 +0100
+@@ -53,9 +53,47 @@
+ int field_dominance = -1;
+
+ int divx_quality = 0;
++char *video_hwaccel_name=NULL;
+
+ const vd_functions_t *mpvdec = NULL;
+
++int get_video_hwaccel(void)
++{
++ static int video_hwaccel = -1;
++ if (video_hwaccel < 0) {
++ video_hwaccel = HWACCEL_NONE;
++ if (video_hwaccel_name) {
++ if (!strcmp(video_hwaccel_name,"xvmc"))
++ video_hwaccel = HWACCEL_XVMC;
++ else if (!strcmp(video_hwaccel_name,"vaapi"))
++ video_hwaccel = HWACCEL_VAAPI;
++ else if (!strcmp(video_hwaccel_name,"vdpau"))
++ video_hwaccel = HWACCEL_VDPAU;
++ }
++ }
++ return video_hwaccel;
++}
++
++const char *get_video_hwaccel_name(int hwaccel)
++{
++ switch (hwaccel) {
++ case HWACCEL_XVMC: return "XvMC";
++ case HWACCEL_VAAPI: return "VA API";
++ case HWACCEL_VDPAU: return "VDPAU";
++ }
++ return NULL;
++}
++
++const char *get_video_hwaccel_short_name(int hwaccel)
++{
++ switch (hwaccel) {
++ case HWACCEL_XVMC: return "xvmc";
++ case HWACCEL_VAAPI: return "vaapi";
++ case HWACCEL_VDPAU: return "vdpau";
++ }
++ return NULL;
++}
++
+ int get_video_quality_max(sh_video_t *sh_video)
+ {
+ vf_instance_t *vf = sh_video->vfilter;
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/dec_video.h mplayer-1.0_rc4_p20120109-new/libmpcodecs/dec_video.h
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/dec_video.h 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/dec_video.h 2012-01-16 15:51:41.000000000 +0100
+@@ -21,6 +21,14 @@
+
+ #include "libmpdemux/stheader.h"
+
++enum {
++ HWACCEL_NONE = 0,
++ HWACCEL_XVMC,
++ HWACCEL_VAAPI,
++ HWACCEL_VDPAU,
++ HWACCEL_COUNT
++};
++
+ extern int field_dominance;
+
+ // dec_video.c:
+@@ -41,6 +49,11 @@
+ void resync_video_stream(sh_video_t *sh_video);
+ int get_current_video_decoder_lag(sh_video_t *sh_video);
+
++int get_video_hwaccel(void);
++const char *get_video_hwaccel_name(int hwaccel);
++const char *get_video_hwaccel_short_name(int hwaccel);
++
+ extern int divx_quality;
++extern char *video_hwaccel_name;
+
+ #endif /* MPLAYER_DEC_VIDEO_H */
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/img_format.c mplayer-1.0_rc4_p20120109-new/libmpcodecs/img_format.c
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/img_format.c 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/img_format.c 2012-01-16 15:51:41.000000000 +0100
+@@ -120,6 +120,14 @@
+ case IMGFMT_VDPAU_MPEG4: return "MPEG-4 Part 2 VDPAU acceleration";
+ case IMGFMT_VDPAU_WMV3: return "WMV3 VDPAU acceleration";
+ case IMGFMT_VDPAU_VC1: return "VC1 VDPAU acceleration";
++ case IMGFMT_VAAPI_MPEG2: return "MPEG-2 VA-API Acceleration";
++ case IMGFMT_VAAPI_MPEG2_IDCT: return "MPEG-2 VA-API Acceleration (Motion Compensation and IDCT)";
++ case IMGFMT_VAAPI_MPEG2_MOCO: return "MPEG-2 VA-API Acceleration (Motion Compensation)";
++ case IMGFMT_VAAPI_MPEG4: return "MPEG-4 VA-API Acceleration";
++ case IMGFMT_VAAPI_H263: return "H.263 VA-API Acceleration";
++ case IMGFMT_VAAPI_H264: return "H.264 VA-API Acceleration";
++ case IMGFMT_VAAPI_WMV3: return "WMV3 VA-API Acceleration";
++ case IMGFMT_VAAPI_VC1: return "VC-1 VA-API Acceleration";
+ }
+ snprintf(unknown_format,20,"Unknown 0x%04x",format);
+ return unknown_format;
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/img_format.h mplayer-1.0_rc4_p20120109-new/libmpcodecs/img_format.h
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/img_format.h 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/img_format.h 2012-01-16 15:51:41.000000000 +0100
+@@ -217,6 +217,26 @@
+ #define IMGFMT_XVMC_MOCO_MPEG2 (IMGFMT_XVMC|0x02)
+ #define IMGFMT_XVMC_IDCT_MPEG2 (IMGFMT_XVMC|0x82)
+
++/* VA-API Formats */
++
++#define IMGFMT_VAAPI 0x56410000 /* 'VA'00 */
++#define IMGFMT_VAAPI_MASK 0xFFFF0000
++#define IMGFMT_IS_VAAPI(fmt) (((fmt) & IMGFMT_VAAPI_MASK) == IMGFMT_VAAPI)
++#define IMGFMT_VAAPI_CODEC_MASK 0x000000F0
++#define IMGFMT_VAAPI_CODEC(fmt) ((fmt) & IMGFMT_VAAPI_CODEC_MASK)
++#define IMGFMT_VAAPI_CODEC_MPEG2 (0x10)
++#define IMGFMT_VAAPI_CODEC_MPEG4 (0x20)
++#define IMGFMT_VAAPI_CODEC_H264 (0x30)
++#define IMGFMT_VAAPI_CODEC_VC1 (0x40)
++#define IMGFMT_VAAPI_MPEG2 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG2)
++#define IMGFMT_VAAPI_MPEG2_IDCT (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG2|1)
++#define IMGFMT_VAAPI_MPEG2_MOCO (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG2|2)
++#define IMGFMT_VAAPI_MPEG4 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG4)
++#define IMGFMT_VAAPI_H263 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG4|1)
++#define IMGFMT_VAAPI_H264 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_H264)
++#define IMGFMT_VAAPI_VC1 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_VC1)
++#define IMGFMT_VAAPI_WMV3 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_VC1|1)
++
+ // VDPAU specific format.
+ #define IMGFMT_VDPAU 0x1DC80000
+ #define IMGFMT_VDPAU_MASK 0xFFFF0000
+@@ -228,7 +248,9 @@
+ #define IMGFMT_VDPAU_VC1 (IMGFMT_VDPAU|0x05)
+ #define IMGFMT_VDPAU_MPEG4 (IMGFMT_VDPAU|0x06)
+
+-#define IMGFMT_IS_HWACCEL(fmt) (IMGFMT_IS_VDPAU(fmt) || IMGFMT_IS_XVMC(fmt))
++#define IMGFMT_IS_HWACCEL(fmt) (IMGFMT_IS_VAAPI(fmt) || \
++ IMGFMT_IS_VDPAU(fmt) || \
++ IMGFMT_IS_XVMC(fmt))
+
+ typedef struct {
+ void* data;
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/vd.c mplayer-1.0_rc4_p20120109-new/libmpcodecs/vd.c
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/vd.c 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/vd.c 2012-01-16 15:51:41.000000000 +0100
+@@ -405,3 +405,12 @@
+ if (vf->draw_slice)
+ vf->draw_slice(vf, src, stride, w, h, x, y);
+ }
++
++void *mpcodecs_get_hwaccel_context(sh_video_t *sh)
++{
++ void *ctx = NULL;
++ struct vf_instance *vf = sh->vfilter;
++ if (vf->control(vf, VFCTRL_GET_HWACCEL_CONTEXT, &ctx) == CONTROL_TRUE)
++ return ctx;
++ return NULL;
++}
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/vd_ffmpeg.c mplayer-1.0_rc4_p20120109-new/libmpcodecs/vd_ffmpeg.c
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/vd_ffmpeg.c 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/vd_ffmpeg.c 2012-01-16 15:51:41.000000000 +0100
+@@ -34,6 +34,7 @@
+ #include "fmt-conversion.h"
+
+ #include "vd_internal.h"
++#include "dec_video.h"
+
+ static const vd_info_t info = {
+ "FFmpeg's libavcodec codec family",
+@@ -192,7 +193,7 @@
+ int imgfmt;
+ if (fmt == PIX_FMT_NONE)
+ return;
+- imgfmt = pixfmt2imgfmt(fmt);
++ imgfmt = pixfmt2imgfmt(fmt, avctx->codec_id);
+ if (IMGFMT_IS_HWACCEL(imgfmt)) {
+ sh_video_t *sh = avctx->opaque;
+ vd_ffmpeg_ctx *ctx = sh->context;
+@@ -453,7 +454,7 @@
+ const AVFrame *src, int offset[4],
+ int y, int type, int height){
+ sh_video_t *sh = s->opaque;
+- uint8_t *source[MP_MAX_PLANES]= {src->data[0] + offset[0], src->data[1] + offset[1], src->data[2] + offset[2]};
++ uint8_t *source[MP_MAX_PLANES]= {src->data[0] + offset[0], src->data[1] + offset[1], src->data[2] + offset[2], src->data[3] + offset[3]};
+ int strides[MP_MAX_PLANES] = {src->linesize[0], src->linesize[1], src->linesize[2]};
+ if (height < 0)
+ {
+@@ -515,9 +516,10 @@
+ sh->disp_w = width;
+ sh->disp_h = height;
+ ctx->pix_fmt = pix_fmt;
+- ctx->best_csp = pixfmt2imgfmt(pix_fmt);
++ ctx->best_csp = pixfmt2imgfmt(pix_fmt, avctx->codec_id);
+ if (!mpcodecs_config_vo(sh, sh->disp_w, sh->disp_h, ctx->best_csp))
+ return -1;
++ avctx->hwaccel_context = mpcodecs_get_hwaccel_context(sh);
+ ctx->vo_initialized = 1;
+ }
+ return 0;
+@@ -948,22 +950,60 @@
+ return mpi;
+ }
+
++static inline int is_hwaccel_format(int imgfmt)
++{
++ switch (get_video_hwaccel()) {
++ case HWACCEL_VAAPI: return IMGFMT_IS_VAAPI(imgfmt) != 0;
++ case HWACCEL_VDPAU: return IMGFMT_IS_VDPAU(imgfmt) != 0;
++ case HWACCEL_XVMC: return IMGFMT_IS_XVMC(imgfmt) != 0;
++ }
++ return 0;
++}
++
++static int query_format(sh_video_t *sh, int fmt)
++{
++ vd_ffmpeg_ctx * const ctx = sh->context;
++ AVCodecContext * const avctx = ctx->avctx;
++ int r, width, height;
++ /* XXX: some codecs have not initialized width and height yet at
++ this point, so we are faking the dimensions so that init_vo()
++ doesn't fail because of 0x0 size */
++ if ((width = avctx->width) == 0)
++ avctx->width = 64;
++ if ((height = avctx->height) == 0)
++ avctx->height = 64;
++ r = init_vo(sh, fmt);
++ avctx->width = width;
++ avctx->height = height;
++ return r;
++}
++
+ static enum PixelFormat get_format(struct AVCodecContext *avctx,
+- const enum PixelFormat *fmt){
+- enum PixelFormat selected_format;
++ const enum PixelFormat *fmt){
++ enum PixelFormat selected_format = PIX_FMT_NONE;
+ 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;
++ 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);
++ if ((try_hwaccel ^ is_hwaccel_format(imgfmt)) != 0)
++ continue;
++ mp_msg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_MPCODECS_TryingPixfmt, i);
++ if (query_format(sh, fmt[i]) >= 0) {
++ if (try_hwaccel) {
++ /* don't allow format conversion for HW acceleration */
++ if (sh->codec->outfmt[sh->outfmtidx] != imgfmt)
++ continue;
++ }
++ selected_format = fmt[i];
++ break;
++ }
+ }
++ if (selected_format != PIX_FMT_NONE)
++ 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);
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/vd.h mplayer-1.0_rc4_p20120109-new/libmpcodecs/vd.h
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/vd.h 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/vd.h 2012-01-16 15:51:41.000000000 +0100
+@@ -64,6 +64,7 @@
+ int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outfmt);
+ mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h);
+ void mpcodecs_draw_slice(sh_video_t *sh, unsigned char** src, int* stride, int w,int h, int x, int y);
++void *mpcodecs_get_hwaccel_context(sh_video_t *sh);
+
+ #define VDFLAGS_DROPFRAME 3
+
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/vf.h mplayer-1.0_rc4_p20120109-new/libmpcodecs/vf.h
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/vf.h 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/vf.h 2012-01-16 15:51:41.000000000 +0100
+@@ -111,6 +111,7 @@
+ #define VFCTRL_GET_PTS 17 /* Return last pts value that reached vf_vo*/
+ #define VFCTRL_SET_DEINTERLACE 18 /* Set deinterlacing status */
+ #define VFCTRL_GET_DEINTERLACE 19 /* Get deinterlacing status */
++#define VFCTRL_GET_HWACCEL_CONTEXT 20 /* Get HW accelerator context */
+
+ #include "vfcap.h"
+
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/vf_vo.c mplayer-1.0_rc4_p20120109-new/libmpcodecs/vf_vo.c
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/vf_vo.c 2012-01-09 14:46:46.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/vf_vo.c 2012-01-16 15:51:41.000000000 +0100
+@@ -136,6 +136,12 @@
+ *(double *)data = vf->priv->pts;
+ return CONTROL_TRUE;
+ }
++ case VFCTRL_GET_HWACCEL_CONTEXT:
++ {
++ if(!video_out) return CONTROL_FALSE; // vo not configured?
++ return(video_out->control(VOCTRL_GET_HWACCEL_CONTEXT, data)
++ == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE;
++ }
+ }
+ // return video_out->control(request,data);
+ return CONTROL_UNKNOWN;
+diff -Naur mplayer-1.0_rc4_p20120109/libvo/gl_common.c mplayer-1.0_rc4_p20120109-new/libvo/gl_common.c
+--- mplayer-1.0_rc4_p20120109/libvo/gl_common.c 2012-01-09 14:46:56.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libvo/gl_common.c 2012-01-16 15:51:41.000000000 +0100
+@@ -140,7 +140,6 @@
+ void (GLAPIENTRY *mpglFreeMemoryMESA)(void *, int, void *);
+ /** \} */ // end of glextfunctions group
+
+-
+ void (GLAPIENTRY *mpglVertexPointer)(GLint, GLenum, GLsizei, const GLvoid *);
+ void (GLAPIENTRY *mpglTexCoordPointer)(GLint, GLenum, GLsizei, const GLvoid *);
+ void (GLAPIENTRY *mpglClientActiveTexture)(GLenum);
+@@ -148,6 +147,12 @@
+ void (GLAPIENTRY *mpglDisableClientState)(GLenum);
+ void (GLAPIENTRY *mpglDrawArrays)(GLenum, GLint, GLsizei);
+
++
++void (GLAPIENTRY *mpglXBindTexImage)(Display *, GLXDrawable, int, const int *);
++void (GLAPIENTRY *mpglXReleaseTexImage)(Display *, GLXDrawable, int);
++GLXPixmap (GLAPIENTRY *mpglXCreatePixmap)(Display *, GLXFBConfig, Pixmap, const int *);
++void (GLAPIENTRY *mpglXDestroyPixmap)(Display *, GLXPixmap);
++
+ //! \defgroup glgeneral OpenGL general helper functions
+
+ //! \defgroup glcontext OpenGL context management helper functions
+@@ -490,6 +495,12 @@
+ {&mpglEnableClientState, NULL, {"glEnableClientState", NULL}},
+ {&mpglDisableClientState, NULL, {"glDisableClientState", NULL}},
+ {&mpglDrawArrays, NULL, {"glDrawArrays", NULL}},
++
++ {&mpglXBindTexImage, "GLX_EXT_texture_from_pixmap", {"glXBindTexImageEXT", NULL}},
++ {&mpglXReleaseTexImage, "GLX_EXT_texture_from_pixmap", {"glXReleaseTexImageEXT", NULL}},
++ {&mpglXCreatePixmap, "GLX_EXT_texture_from_pixmap", {"glXCreatePixmap", NULL}},
++ {&mpglXDestroyPixmap, "GLX_EXT_texture_from_pixmap", {"glXDestroyPixmap", NULL}},
++
+ {NULL}
+ };
+
+diff -Naur mplayer-1.0_rc4_p20120109/libvo/gl_common.h mplayer-1.0_rc4_p20120109-new/libvo/gl_common.h
+--- mplayer-1.0_rc4_p20120109/libvo/gl_common.h 2012-01-09 14:46:56.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libvo/gl_common.h 2012-01-16 15:51:41.000000000 +0100
+@@ -533,4 +533,9 @@
+ extern void* (GLAPIENTRY *mpglAllocateMemoryMESA)(void *, int, size_t, float, float, float);
+ extern void (GLAPIENTRY *mpglFreeMemoryMESA)(void *, int, void *);
+
++extern void (GLAPIENTRY *mpglXBindTexImage)(Display *, GLXDrawable, int, const int *);
++extern void (GLAPIENTRY *mpglXReleaseTexImage)(Display *, GLXDrawable, int);
++extern GLXPixmap (GLAPIENTRY *mpglXCreatePixmap)(Display *, GLXFBConfig, Pixmap, const int *);
++extern void (GLAPIENTRY *mpglXDestroyPixmap)(Display *, GLXPixmap);
++
+ #endif /* MPLAYER_GL_COMMON_H */
+diff -Naur mplayer-1.0_rc4_p20120109/libvo/stats.c mplayer-1.0_rc4_p20120109-new/libvo/stats.c
+--- mplayer-1.0_rc4_p20120109/libvo/stats.c 1970-01-01 01:00:00.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libvo/stats.c 2012-01-16 15:51:41.000000000 +0100
+@@ -0,0 +1,217 @@
++#include "config.h"
++#include "stats.h"
++#include <time.h>
++#include <stdio.h>
++#include <string.h>
++#include <unistd.h>
++#include <locale.h>
++#include <inttypes.h>
++
++#if CONFIG_LIBGTOP
++#include <glibtop/cpu.h>
++#include <glibtop/proctime.h>
++#include <glibtop/procstate.h>
++#endif
++
++// Process statistics
++struct proc_stats {
++ uint64_t utime;
++ uint64_t stime;
++ uint64_t cutime;
++ uint64_t cstime;
++ uint64_t frequency;
++ uint64_t cpu_time;
++ uint64_t start_time;
++ uint64_t current_time;
++};
++
++// Get current process stats
++static int get_proc_stats(struct proc_stats *pstats);
++
++void stats_init(void)
++{
++#if CONFIG_LIBGTOP
++ glibtop_init();
++#endif
++}
++
++void stats_exit(void)
++{
++#if CONFIG_LIBGTOP
++ glibtop_close();
++#endif
++}
++
++// Get CPU frequency
++unsigned int get_cpu_frequency(void)
++{
++ unsigned int freq = 0;
++#if defined __linux__
++ {
++ FILE *proc_file = fopen("/proc/cpuinfo", "r");
++ if (proc_file) {
++ char line[256];
++ char *old_locale = setlocale(LC_NUMERIC, NULL);
++ setlocale(LC_NUMERIC, "C");
++ while(fgets(line, sizeof(line), proc_file)) {
++ float f;
++ int len = strlen(line);
++ if (len == 0)
++ continue;
++ line[len - 1] = 0;
++ if (sscanf(line, "cpu MHz : %f", &f) == 1)
++ freq = (unsigned int)f;
++ }
++ setlocale(LC_NUMERIC, old_locale);
++ fclose(proc_file);
++ }
++ }
++#endif
++ return freq;
++}
++
++// Get CPU usage in percent
++static float get_cpu_usage_1(void)
++{
++ static struct proc_stats prev_stats;
++ struct proc_stats curr_stats;
++ uint64_t prev_proc_time = 0, curr_proc_time = 0;
++ float pcpu = 0.0f;
++
++ if (get_proc_stats(&curr_stats) == 0) {
++ prev_proc_time += prev_stats.utime;
++ prev_proc_time += prev_stats.stime;
++ prev_proc_time += prev_stats.cutime;
++ prev_proc_time += prev_stats.cstime;
++ curr_proc_time += curr_stats.utime;
++ curr_proc_time += curr_stats.stime;
++ curr_proc_time += curr_stats.cutime;
++ curr_proc_time += curr_stats.cstime;
++ if (prev_stats.start_time > 0)
++ pcpu = 100.0 * ((float)(curr_proc_time - prev_proc_time) /
++ (float)(curr_stats.cpu_time - prev_stats.cpu_time));
++ prev_stats = curr_stats;
++ }
++ return pcpu;
++}
++
++float get_cpu_usage(enum CpuUsageType type)
++{
++ static float pcpu_total = 0.0;
++ static unsigned int n_samples;
++ float pcpu;
++
++ pcpu = get_cpu_usage_1();
++ pcpu_total += pcpu / 100.0;
++ ++n_samples;
++
++ if (type == CPU_USAGE_AVERAGE)
++ pcpu = 100.0 * (pcpu_total / n_samples);
++ return pcpu;
++}
++
++// For ELF executable, notes are pushed before environment and args
++static int find_elf_note(unsigned long match, unsigned long *pval)
++{
++ unsigned long *ep = (unsigned long *)__environ;
++ while (*ep++);
++ for (; *ep != 0; ep += 2) {
++ if (ep[0] == match) {
++ *pval = ep[1];
++ return 0;
++ }
++ }
++ return -1;
++}
++
++#ifndef AT_CLKTCK
++#define AT_CLKTCK 17
++#endif
++
++// Get current process stats
++int get_proc_stats(struct proc_stats *pstats)
++{
++ int error = -1;
++ char line[256], *str, *end;
++ char vc;
++ int vi;
++ unsigned long vul;
++ unsigned long long vull;
++ float vf;
++#if defined __linux__
++ {
++ FILE *proc_file = fopen("/proc/self/stat", "r");
++ if (proc_file) {
++ if (fgets(line, sizeof(line), proc_file)) {
++ unsigned long utime, stime, cutime, cstime, start_time;
++ str = strrchr(line, ')');
++ if (str && sscanf(str + 2,
++ "%c "
++ "%d %d %d %d %d "
++ "%lu %lu %lu %lu %lu %lu %lu "
++ "%ld %ld %ld %ld %ld %ld "
++ "%lu %lu ",
++ &vc,
++ &vi, &vi, &vi, &vi, &vi,
++ &vul, &vul, &vul, &vul, &vul, &utime, &stime,
++ &cutime, &cstime, &vul, &vul, &vul, &vul,
++ &start_time, &vul) == 21) {
++ pstats->utime = utime;
++ pstats->stime = stime;
++ pstats->cutime = cutime;
++ pstats->cstime = cstime;
++ pstats->start_time = start_time;
++ error = 0;
++ }
++ }
++ fclose(proc_file);
++ }
++ if (error)
++ return error;
++ error = -1;
++
++ if (find_elf_note(AT_CLKTCK, &vul) == 0) {
++ pstats->frequency = vul;
++ error = 0;
++ }
++ if (error)
++ return error;
++ error = -1;
++
++ proc_file = fopen("/proc/uptime", "r");
++ if (proc_file) {
++ if (fgets(line, sizeof(line), proc_file)) {
++ char *old_locale = setlocale(LC_NUMERIC, NULL);
++ setlocale(LC_NUMERIC, "C");
++ if (sscanf(line, "%f", &vf) == 1) {
++ pstats->cpu_time = (uint64_t)(vf * (float)pstats->frequency);
++ error = 0;
++ }
++ setlocale(LC_NUMERIC, old_locale);
++ }
++ fclose(proc_file);
++ }
++ }
++#elif CONFIG_LIBGTOP
++ {
++ glibtop_cpu cpu;
++ glibtop_proc_time proc_time;
++ glibtop_proc_state proc_state;
++
++ glibtop_get_cpu(&cpu);
++ glibtop_get_proc_state(&proc_state, getpid());
++ pstats->cpu_time = cpu.xcpu_total[proc_state.processor];
++
++ glibtop_get_proc_time(&proc_time, getpid());
++ pstats->utime = proc_time.utime;
++ pstats->stime = proc_time.stime;
++ pstats->cutime = proc_time.cutime;
++ pstats->cstime = proc_time.cstime;
++ pstats->start_time = proc_time.start_time;
++ pstats->frequency = proc_time.frequency;
++
++ error = 0;
++ }
++#endif
++ return error;
++}
+diff -Naur mplayer-1.0_rc4_p20120109/libvo/stats.h mplayer-1.0_rc4_p20120109-new/libvo/stats.h
+--- mplayer-1.0_rc4_p20120109/libvo/stats.h 1970-01-01 01:00:00.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libvo/stats.h 2012-01-16 15:51:41.000000000 +0100
+@@ -0,0 +1,21 @@
++#ifndef MPLAYER_STATS_H
++#define MPLAYER_STATS_H
++
++#include <stdint.h>
++
++void stats_init(void);
++void stats_exit(void);
++
++/// CPU usage model
++enum CpuUsageType {
++ CPU_USAGE_QUANTUM = 1, ///< CPU usage since the last call to cpu_get_usage()
++ CPU_USAGE_AVERAGE ///< CPU usage average'd since program start
++};
++
++/// Get CPU frequency
++unsigned int get_cpu_frequency(void);
++
++/// Get CPU usage in percent
++float get_cpu_usage(enum CpuUsageType type);
++
++#endif /* MPLAYER_STATS_H */
+diff -Naur mplayer-1.0_rc4_p20120109/libvo/video_out.c mplayer-1.0_rc4_p20120109-new/libvo/video_out.c
+--- mplayer-1.0_rc4_p20120109/libvo/video_out.c 2012-01-09 14:46:56.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libvo/video_out.c 2012-01-16 15:51:41.000000000 +0100
+@@ -94,6 +94,7 @@
+ extern const vo_functions_t video_out_xmga;
+ extern const vo_functions_t video_out_x11;
+ extern const vo_functions_t video_out_xvmc;
++extern const vo_functions_t video_out_vaapi;
+ extern const vo_functions_t video_out_vdpau;
+ extern const vo_functions_t video_out_xv;
+ extern const vo_functions_t video_out_gl_nosw;
+@@ -297,6 +298,9 @@
+ #ifdef CONFIG_MNG
+ &video_out_mng,
+ #endif
++#if CONFIG_VAAPI
++ &video_out_vaapi,
++#endif
+ NULL
+ };
+
+diff -Naur mplayer-1.0_rc4_p20120109/libvo/video_out.h mplayer-1.0_rc4_p20120109-new/libvo/video_out.h
+--- mplayer-1.0_rc4_p20120109/libvo/video_out.h 2012-01-09 14:46:56.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libvo/video_out.h 2012-01-16 15:51:41.000000000 +0100
+@@ -80,6 +80,10 @@
+
+ #define VOCTRL_UPDATE_SCREENINFO 32
+
++// Return current HW acceleration context
++// void *get_hwaccel_context(void);
++#define VOCTRL_GET_HWACCEL_CONTEXT 33
++
+ // Vo can be used by xover
+ #define VOCTRL_XOVERLAY_SUPPORT 22
+
+diff -Naur mplayer-1.0_rc4_p20120109/libvo/vo_vaapi.c mplayer-1.0_rc4_p20120109-new/libvo/vo_vaapi.c
+--- mplayer-1.0_rc4_p20120109/libvo/vo_vaapi.c 1970-01-01 01:00:00.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libvo/vo_vaapi.c 2012-01-16 15:51:41.000000000 +0100
+@@ -0,0 +1,2728 @@
++/*
++ * VA API output module
++ *
++ * Copyright (C) 2008-2009 Splitted-Desktop Systems
++ *
++ * This file is part of MPlayer.
++ *
++ * MPlayer is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * MPlayer is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License along
++ * with MPlayer; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++ */
++
++#include "config.h"
++#include "mp_msg.h"
++#include "help_mp.h"
++#include "subopt-helper.h"
++#include "video_out.h"
++#include "video_out_internal.h"
++#include "fastmemcpy.h"
++#include "sub/sub.h"
++#include "sub/eosd.h"
++#include "x11_common.h"
++#include "libavutil/common.h"
++#include "libavcodec/vaapi.h"
++#include "gui/interface.h"
++#include "stats.h"
++#include <stdarg.h>
++
++#if CONFIG_GL
++#include "gl_common.h"
++#include <GL/glu.h>
++#include <GL/glx.h>
++#endif
++
++#include <assert.h>
++#include <X11/Xlib.h>
++#include <X11/Xutil.h>
++#include <va/va_x11.h>
++#if CONFIG_VAAPI_GLX
++#include <va/va_glx.h>
++#endif
++
++#if CONFIG_XRENDER
++#include <X11/extensions/Xrender.h>
++#endif
++
++/* Compatibility glue with upstream libva */
++#ifndef VA_SDS_VERSION
++#define VA_SDS_VERSION 0
++#endif
++
++/* Compatibility glue with VA-API >= 0.30 */
++#ifndef VA_INVALID_ID
++#define VA_INVALID_ID 0xffffffff
++#endif
++#ifndef VA_FOURCC
++#define VA_FOURCC(ch0, ch1, ch2, ch3) \
++ ((uint32_t)(uint8_t)(ch0) | \
++ ((uint32_t)(uint8_t)(ch1) << 8) | \
++ ((uint32_t)(uint8_t)(ch2) << 16) | \
++ ((uint32_t)(uint8_t)(ch3) << 24 ))
++#endif
++#if defined VA_SRC_BT601 && defined VA_SRC_BT709
++# define USE_VAAPI_COLORSPACE 1
++#else
++# define USE_VAAPI_COLORSPACE 0
++#endif
++
++/* Defined to 1 if VA/GLX 'bind' API is available */
++#define USE_VAAPI_GLX_BIND \
++ (VA_MAJOR_VERSION == 0 && \
++ ((VA_MINOR_VERSION == 30 && \
++ VA_MICRO_VERSION == 4 && VA_SDS_VERSION >= 5) || \
++ (VA_MINOR_VERSION == 31 && \
++ VA_MICRO_VERSION == 0 && VA_SDS_VERSION >= 1 && VA_SDS_VERSION < 5)))
++
++/* Compatibility glue with VA-API >= 0.31 */
++#if defined VA_CHECK_VERSION
++#if VA_CHECK_VERSION(0,31,0)
++#define vaPutImage2 vaPutImage
++#define vaAssociateSubpicture2 vaAssociateSubpicture
++#endif
++#endif
++
++/* Compatibility glue with VA-API >= 0.31.1 */
++#ifndef VA_SRC_SMPTE_240
++#define VA_SRC_SMPTE_240 0x00000040
++#endif
++#if defined VA_FILTER_SCALING_MASK
++# define USE_VAAPI_SCALING 1
++#else
++# define USE_VAAPI_SCALING 0
++#endif
++
++static vo_info_t info = {
++ "VA API with X11",
++ "vaapi",
++ "Gwenole Beauchesne <gbeauchesne@splitted-desktop.com>",
++ ""
++};
++
++const LIBVO_EXTERN(vaapi)
++
++/* Numbers of video surfaces */
++#define MAX_OUTPUT_SURFACES 2 /* Maintain synchronisation points in flip_page() */
++#define MAX_VIDEO_SURFACES 21 /* Maintain free surfaces in a queue (use least-recently-used) */
++#define NUM_VIDEO_SURFACES_MPEG2 3 /* 1 decode frame, up to 2 references */
++#define NUM_VIDEO_SURFACES_MPEG4 3 /* 1 decode frame, up to 2 references */
++#define NUM_VIDEO_SURFACES_H264 21 /* 1 decode frame, up to 20 references */
++#define NUM_VIDEO_SURFACES_VC1 3 /* 1 decode frame, up to 2 references */
++
++static void ensure_osd(void);
++static int reset_xrender_specific(void);
++
++typedef void (*draw_alpha_func)(int x0, int y0, int w, int h,
++ unsigned char *src, unsigned char *srca,
++ int stride);
++
++typedef void (*eosd_draw_alpha_func)(unsigned char *src,
++ int src_w, int src_h, int src_stride,
++ int dst_x, int dst_y,
++ uint32_t color);
++
++struct vaapi_surface {
++ VASurfaceID id;
++ VAImage image;
++ int is_bound; /* Flag: image bound to the surface? */
++};
++
++struct vaapi_equalizer {
++ VADisplayAttribute brightness;
++ VADisplayAttribute contrast;
++ VADisplayAttribute hue;
++ VADisplayAttribute saturation;
++};
++
++static int g_is_visible;
++static int g_is_paused;
++static uint32_t g_image_width;
++static uint32_t g_image_height;
++static uint32_t g_image_format;
++static uint32_t g_image_fields;
++static Pixmap g_image_pixmap;
++static struct vo_rect g_output_rect;
++static struct vaapi_surface *g_output_surfaces[MAX_OUTPUT_SURFACES];
++static unsigned int g_output_surface;
++static int g_deint;
++static int g_deint_type;
++static int g_colorspace;
++static unsigned int g_scaling;
++
++static int gl_enabled;
++static int gl_use_tfp;
++#if CONFIG_GL
++static MPGLContext gl_context;
++static int gl_binding;
++static int gl_reflect;
++static int gl_finish;
++static GLuint gl_texture;
++static GLuint gl_font_base;
++static Pixmap gl_pixmap;
++static int gl_visual_attr[] = {
++ GLX_RGBA,
++ GLX_RED_SIZE, 1,
++ GLX_GREEN_SIZE, 1,
++ GLX_BLUE_SIZE, 1,
++ GLX_DOUBLEBUFFER,
++ GL_NONE
++};
++#endif
++
++#if CONFIG_VAAPI_GLX
++static void *gl_surface;
++#endif
++
++static int xr_enabled;
++#if CONFIG_XRENDER
++static Picture xr_video_picture;
++static Picture xr_window_picture;
++#endif
++
++static struct vaapi_context *va_context;
++static VAProfile *va_profiles;
++static int va_num_profiles;
++static VAEntrypoint *va_entrypoints;
++static int va_num_entrypoints;
++static VASurfaceID *va_surface_ids;
++static int va_num_surfaces;
++static struct vaapi_surface **va_free_surfaces;
++static int va_free_surfaces_head_index;
++static int va_free_surfaces_tail_index;
++static VAImageFormat *va_image_formats;
++static int va_num_image_formats;
++static VAImageFormat *va_subpic_formats;
++static unsigned int *va_subpic_flags;
++static int va_num_subpic_formats;
++static VAImage va_osd_image;
++static uint8_t *va_osd_image_data;
++static VASubpictureID va_osd_subpicture;
++static int va_osd_associated;
++static draw_alpha_func va_osd_draw_alpha;
++static uint8_t *va_osd_palette;
++static struct vaapi_equalizer va_equalizer;
++static VAImage va_eosd_image;
++static uint8_t *va_eosd_image_data;
++static VASubpictureID va_eosd_subpicture;
++static int va_eosd_associated;
++static eosd_draw_alpha_func va_eosd_draw_alpha;
++
++///< Flag: direct surface mapping: use mpi->number to select free VA surface?
++static int va_dm;
++
++///< Flag: gather run-time statistics (CPU usage, frequency)
++static int cpu_stats;
++static unsigned int cpu_frequency;
++static float cpu_usage;
++
++// X error trap
++static int x11_error_code = 0;
++static int (*old_error_handler)(Display *, XErrorEvent *);
++
++static int error_handler(Display *dpy, XErrorEvent *error)
++{
++ x11_error_code = error->error_code;
++ return 0;
++}
++
++static void x11_trap_errors(void)
++{
++ x11_error_code = 0;
++ old_error_handler = XSetErrorHandler(error_handler);
++}
++
++static int x11_untrap_errors(void)
++{
++ XSetErrorHandler(old_error_handler);
++ return x11_error_code;
++}
++
++static int check_status(VAStatus status, const char *msg)
++{
++ if (status != VA_STATUS_SUCCESS) {
++ mp_msg(MSGT_VO, MSGL_ERR, "[vo_vaapi] %s: %s\n", msg, vaErrorStr(status));
++ return 0;
++ }
++ return 1;
++}
++
++static const char *string_of_VAImageFormat(VAImageFormat *imgfmt)
++{
++ static char str[5];
++ str[0] = imgfmt->fourcc;
++ str[1] = imgfmt->fourcc >> 8;
++ str[2] = imgfmt->fourcc >> 16;
++ str[3] = imgfmt->fourcc >> 24;
++ str[4] = '\0';
++ return str;
++}
++
++static const char *string_of_VAProfile(VAProfile profile)
++{
++ switch (profile) {
++#define PROFILE(profile) \
++ case VAProfile##profile: return "VAProfile" #profile
++ PROFILE(MPEG2Simple);
++ PROFILE(MPEG2Main);
++ PROFILE(MPEG4Simple);
++ PROFILE(MPEG4AdvancedSimple);
++ PROFILE(MPEG4Main);
++ PROFILE(H264Baseline);
++ PROFILE(H264Main);
++ PROFILE(H264High);
++ PROFILE(VC1Simple);
++ PROFILE(VC1Main);
++ PROFILE(VC1Advanced);
++#undef PROFILE
++ }
++ return "<unknown>";
++}
++
++static const char *string_of_VAEntrypoint(VAEntrypoint entrypoint)
++{
++ switch (entrypoint) {
++#define ENTRYPOINT(entrypoint) \
++ case VAEntrypoint##entrypoint: return "VAEntrypoint" #entrypoint
++ ENTRYPOINT(VLD);
++ ENTRYPOINT(IZZ);
++ ENTRYPOINT(IDCT);
++ ENTRYPOINT(MoComp);
++ ENTRYPOINT(Deblocking);
++#undef ENTRYPOINT
++ }
++ return "<unknown>";
++}
++
++static int has_profile(VAProfile profile)
++{
++ if (va_profiles && va_num_profiles > 0) {
++ int i;
++ for (i = 0; i < va_num_profiles; i++) {
++ if (va_profiles[i] == profile)
++ return 1;
++ }
++ }
++ return 0;
++}
++
++static int VAProfile_from_imgfmt(uint32_t format)
++{
++ static const int mpeg2_profiles[] =
++ { VAProfileMPEG2Main, VAProfileMPEG2Simple, -1 };
++ static const int mpeg4_profiles[] =
++ { VAProfileMPEG4Main, VAProfileMPEG4AdvancedSimple, VAProfileMPEG4Simple, -1 };
++ static const int h264_profiles[] =
++ { VAProfileH264High, VAProfileH264Main, VAProfileH264Baseline, -1 };
++ static const int wmv3_profiles[] =
++ { VAProfileVC1Main, VAProfileVC1Simple, -1 };
++ static const int vc1_profiles[] =
++ { VAProfileVC1Advanced, -1 };
++
++ const int *profiles = NULL;
++ switch (IMGFMT_VAAPI_CODEC(format)) {
++ case IMGFMT_VAAPI_CODEC_MPEG2:
++ profiles = mpeg2_profiles;
++ break;
++ case IMGFMT_VAAPI_CODEC_MPEG4:
++ profiles = mpeg4_profiles;
++ break;
++ case IMGFMT_VAAPI_CODEC_H264:
++ profiles = h264_profiles;
++ break;
++ case IMGFMT_VAAPI_CODEC_VC1:
++ switch (format) {
++ case IMGFMT_VAAPI_WMV3:
++ profiles = wmv3_profiles;
++ break;
++ case IMGFMT_VAAPI_VC1:
++ profiles = vc1_profiles;
++ break;
++ }
++ break;
++ }
++
++ if (profiles) {
++ for (int i = 0; profiles[i] != -1; i++) {
++ if (has_profile(profiles[i]))
++ return profiles[i];
++ }
++ }
++ return -1;
++}
++
++static int has_entrypoint(VAEntrypoint entrypoint)
++{
++ if (va_entrypoints && va_num_entrypoints > 0) {
++ int i;
++ for (i = 0; i < va_num_entrypoints; i++) {
++ if (va_entrypoints[i] == entrypoint)
++ return 1;
++ }
++ }
++ return 0;
++}
++
++static int VAEntrypoint_from_imgfmt(uint32_t format)
++{
++ int entrypoint = 0;
++ switch (format) {
++ case IMGFMT_VAAPI_MPEG2:
++ case IMGFMT_VAAPI_MPEG4:
++ case IMGFMT_VAAPI_H263:
++ case IMGFMT_VAAPI_H264:
++ case IMGFMT_VAAPI_WMV3:
++ case IMGFMT_VAAPI_VC1:
++ entrypoint = VAEntrypointVLD;
++ break;
++ case IMGFMT_VAAPI_MPEG2_IDCT:
++ entrypoint = VAEntrypointIDCT;
++ break;
++ case IMGFMT_VAAPI_MPEG2_MOCO:
++ entrypoint = VAEntrypointMoComp;
++ break;
++ }
++
++ if (entrypoint)
++ return has_entrypoint(entrypoint);
++
++ return -1;
++}
++
++static VAImageFormat *find_image_format(uint32_t fourcc)
++{
++ if (va_image_formats && va_num_image_formats > 0) {
++ int i;
++ for (i = 0; i < va_num_image_formats; i++) {
++ if (va_image_formats[i].fourcc == fourcc)
++ return &va_image_formats[i];
++ }
++ }
++ return NULL;
++}
++
++static VAImageFormat *VAImageFormat_from_imgfmt(uint32_t format)
++{
++ uint32_t fourcc = 0;
++
++ switch (format) {
++ case IMGFMT_NV12: fourcc = VA_FOURCC('N','V','1','2'); break;
++ case IMGFMT_YV12: fourcc = VA_FOURCC('Y','V','1','2'); break;
++ case IMGFMT_I420: fourcc = VA_FOURCC('I','4','2','0'); break;
++ case IMGFMT_IYUV: fourcc = VA_FOURCC('I','Y','U','V'); break;
++ }
++
++ if (fourcc)
++ return find_image_format(fourcc);
++
++ return NULL;
++}
++
++static struct vaapi_surface *alloc_vaapi_surface(unsigned int width,
++ unsigned int height,
++ unsigned int format)
++{
++ struct vaapi_surface *surface = NULL;
++ struct vaapi_surface **surfaces;
++ VASurfaceID *surface_ids;
++ VAStatus status;
++
++ surface = calloc(1, sizeof(*surface));
++ if (!surface)
++ goto error;
++
++ surfaces = realloc(va_free_surfaces,
++ (1 + va_num_surfaces) * sizeof(surfaces[0]));
++ if (!surfaces)
++ goto error;
++
++ surface_ids = realloc(va_surface_ids,
++ (1 + va_num_surfaces) * sizeof(surface_ids[0]));
++ if (!surface_ids)
++ goto error;
++
++ status = vaCreateSurfaces(va_context->display, width, height, format,
++ 1, &surface->id);
++ if (!check_status(status, "vaCreateSurfaces()"))
++ goto error;
++
++ va_surface_ids = surface_ids;
++ va_surface_ids[va_num_surfaces] = surface->id;
++ va_free_surfaces = surfaces;
++ va_free_surfaces[va_num_surfaces] = surface;
++ surface->image.image_id = VA_INVALID_ID;
++ surface->image.buf = VA_INVALID_ID;
++ ++va_num_surfaces;
++ return surface;
++error:
++ free(surface);
++ return NULL;
++}
++
++static void resize(void)
++{
++ struct vo_rect src;
++
++ calc_src_dst_rects(g_image_width, g_image_height,
++ &src, &g_output_rect, NULL, NULL);
++
++ ensure_osd();
++
++ vo_x11_clearwindow(mDisplay, vo_window);
++
++#if CONFIG_GL
++#define FOVY 60.0f
++#define ASPECT 1.0f
++#define Z_NEAR 0.1f
++#define Z_FAR 100.0f
++#define Z_CAMERA 0.869f
++
++ if (gl_enabled) {
++ glViewport(0, 0, vo_dwidth, vo_dheight);
++ glMatrixMode(GL_PROJECTION);
++ glLoadIdentity();
++ gluPerspective(FOVY, ASPECT, Z_NEAR, Z_FAR);
++ glMatrixMode(GL_MODELVIEW);
++ glLoadIdentity();
++
++ glTranslatef(-0.5f, -0.5f, -Z_CAMERA);
++ glScalef(1.0f / (GLfloat)vo_dwidth,
++ -1.0f / (GLfloat)vo_dheight,
++ 1.0f / (GLfloat)vo_dwidth);
++ glTranslatef(0.0f, -1.0f * (GLfloat)vo_dheight, 0.0f);
++ }
++#endif
++
++#if CONFIG_XRENDER
++ if (xr_enabled)
++ reset_xrender_specific();
++#endif
++
++ if (g_is_visible)
++ flip_page();
++}
++
++#if CONFIG_GL
++static int gl_build_font(void)
++{
++ XFontStruct *fi;
++
++ gl_font_base = glGenLists(96);
++
++ fi = XLoadQueryFont(mDisplay, "-adobe-helvetica-medium-r-normal--16-*-*-*-p-*-iso8859-1" );
++ if (!fi) {
++ fi = XLoadQueryFont(mDisplay, "fixed");
++ if (!fi)
++ return -1;
++ }
++
++ glXUseXFont(fi->fid, 32, 96, gl_font_base);
++ XFreeFont(mDisplay, fi);
++ return 0;
++}
++
++static void gl_printf(const char *format, ...)
++{
++ va_list args;
++ char *text;
++ int textlen;
++
++ va_start(args, format);
++ textlen = vsnprintf(NULL, 0, format, args);
++ va_end(args);
++
++ text = malloc(textlen + 1);
++ if (!text)
++ return;
++
++ va_start(args, format);
++ vsprintf(text, format, args);
++ va_end(args);
++
++ glPushAttrib(GL_LIST_BIT);
++ glListBase(gl_font_base - 32);
++ glCallLists(textlen, GL_UNSIGNED_BYTE, text);
++ glPopAttrib();
++ free(text);
++}
++
++static void gl_draw_rectangle(int x, int y, int w, int h, unsigned int rgba)
++{
++ glColor4f((GLfloat)((rgba >> 24) & 0xff) / 255.0,
++ (GLfloat)((rgba >> 16) & 0xff) / 255.0,
++ (GLfloat)((rgba >> 8) & 0xff) / 255.0,
++ (GLfloat)(rgba & 0xff) / 255.0);
++
++ glTranslatef((GLfloat)x, (GLfloat)y, 0.0f);
++ glBegin(GL_QUADS);
++ {
++ glVertex2i(0, 0);
++ glVertex2i(w, 0);
++ glVertex2i(w, h);
++ glVertex2i(0, h);
++ }
++ glEnd();
++}
++#endif
++
++#if CONFIG_XRENDER
++static int init_xrender(void)
++{
++ int dummy;
++
++ return XRenderQueryExtension(mDisplay, &dummy, &dummy);
++}
++
++static void uninit_xrender(void)
++{
++}
++#endif
++
++static inline unsigned char *get_osd_image_data(int x0, int y0)
++{
++ return (va_osd_image_data +
++ va_osd_image.offsets[0] +
++ va_osd_image.pitches[0] * y0 +
++ x0 * ((va_osd_image.format.bits_per_pixel + 7) / 8));
++}
++
++static void draw_alpha_rgb32(int x0, int y0, int w, int h,
++ unsigned char *src, unsigned char *srca,
++ int stride)
++{
++ int x, y;
++ const unsigned int dststride = va_osd_image.pitches[0];
++ unsigned char *dst = get_osd_image_data(x0, y0);
++
++ for (y = 0; y < h; y++, dst += dststride, src += stride, srca += stride)
++ for (x = 0; x < w; x++) {
++ const unsigned char c = src[x];
++ dst[4*x + 0] = c;
++ dst[4*x + 1] = c;
++ dst[4*x + 2] = c;
++ dst[4*x + 3] = -srca[x];
++ }
++}
++
++static void draw_alpha_IA44(int x0, int y0, int w, int h,
++ unsigned char *src, unsigned char *srca,
++ int stride)
++{
++ int x, y;
++ const unsigned int dststride = va_osd_image.pitches[0];
++ unsigned char *dst = get_osd_image_data(x0, y0);
++
++ for (y = 0; y < h; y++, dst += dststride)
++ for (x = 0; x < w; x++)
++ dst[x] = (src[y*stride + x] >> 4) | (-srca[y*stride + x] & 0xf0);
++}
++
++static void draw_alpha_AI44(int x0, int y0, int w, int h,
++ unsigned char *src, unsigned char *srca,
++ int stride)
++{
++ int x, y;
++ const unsigned int dststride = va_osd_image.pitches[0];
++ unsigned char *dst = get_osd_image_data(x0, y0);
++
++ for (y = 0; y < h; y++, dst += dststride)
++ for (x = 0; x < w; x++)
++ dst[x] = (src[y*stride + x] & 0xf0) | (-srca[y*stride + x] >> 4);
++}
++
++static void draw_alpha_IA88(int x0, int y0, int w, int h,
++ unsigned char *src, unsigned char *srca,
++ int stride)
++{
++ int x, y;
++ const unsigned int dststride = va_osd_image.pitches[0];
++ unsigned char *dst = get_osd_image_data(x0, y0);
++
++ for (y = 0; y < h; y++, dst += dststride)
++ for (x = 0; x < w; x++) {
++ dst[2*x + 0] = src [y*stride + x];
++ dst[2*x + 1] = -srca[y*stride + x];
++ }
++}
++
++static void draw_alpha_AI88(int x0, int y0, int w, int h,
++ unsigned char *src, unsigned char *srca,
++ int stride)
++{
++ int x, y;
++ const unsigned int dststride = va_osd_image.pitches[0];
++ unsigned char *dst = get_osd_image_data(x0, y0);
++
++ for (y = 0; y < h; y++, dst += dststride)
++ for (x = 0; x < w; x++) {
++ dst[2*x + 0] = -srca[y*stride + x];
++ dst[2*x + 1] = src [y*stride + x];
++ }
++}
++
++///< List of subpicture formats in preferred order
++static const struct {
++ uint32_t format;
++ draw_alpha_func draw_alpha;
++}
++va_osd_info[] = {
++ { VA_FOURCC('I','A','4','4'), draw_alpha_IA44 },
++ { VA_FOURCC('A','I','4','4'), draw_alpha_AI44 },
++ { VA_FOURCC('I','A','8','8'), draw_alpha_IA88 },
++ { VA_FOURCC('A','I','8','8'), draw_alpha_AI88 },
++ { VA_FOURCC('B','G','R','A'), draw_alpha_rgb32 },
++ { VA_FOURCC('R','G','B','A'), draw_alpha_rgb32 },
++ { 0, NULL }
++};
++
++static uint8_t *gen_osd_palette(const VAImage *image)
++{
++ uint8_t *palette;
++ int i, is_rgb;
++ int r_idx = -1, g_idx = -1, b_idx = -1;
++ int y_idx = -1, u_idx = -1, v_idx = -1;
++ int i_idx = -1, a_idx = -1;
++
++ if (image->num_palette_entries < 1)
++ return NULL;
++
++ palette = malloc(image->num_palette_entries * image->entry_bytes);
++ if (!palette)
++ return NULL;
++
++ for (i = 0; i < image->entry_bytes; i++) {
++ switch (image->component_order[i]) {
++ case 'R': r_idx = i; is_rgb = 1; break;
++ case 'G': g_idx = i; is_rgb = 1; break;
++ case 'B': b_idx = i; is_rgb = 1; break;
++ case 'Y': y_idx = i; is_rgb = 0; break;
++ case 'U': u_idx = i; is_rgb = 0; break;
++ case 'V': v_idx = i; is_rgb = 0; break;
++ case 'I': i_idx = i; break;
++ case 'A': a_idx = i; break;
++ }
++ }
++
++ if (r_idx != -1 && g_idx != -1 && b_idx != -1) { /* RGB format */
++ for (i = 0; i < image->num_palette_entries; i++) {
++ const int n = i * image->entry_bytes;
++ palette[n + r_idx] = i * 0xff / (image->num_palette_entries - 1);
++ palette[n + g_idx] = i * 0xff / (image->num_palette_entries - 1);
++ palette[n + b_idx] = i * 0xff / (image->num_palette_entries - 1);
++ }
++ }
++ else if (y_idx != -1 && u_idx != -1 && v_idx != -1) { /* YUV format */
++ for (i = 0; i < image->num_palette_entries; i++) {
++ const int n = i * image->entry_bytes;
++ palette[n + y_idx] = i * 0xff / (image->num_palette_entries - 1);
++ palette[n + u_idx] = 0x80;
++ palette[n + v_idx] = 0x80;
++ }
++ }
++ else if (i_idx != -1 && a_idx != -1) {/* AYUV format (GMA500 "psb" bug) */
++ for (i = 0; i < image->num_palette_entries; i++) {
++ const int n = i * image->entry_bytes;
++ palette[n + 0] = 0x80;
++ palette[n + 1] = 0x80;
++ palette[n + 2] = 16 + i * 220 / (image->num_palette_entries - 1);
++ palette[n + 3] = 0;
++ }
++ }
++ else {
++ mp_msg(MSGT_VO, MSGL_ERR, "[vo_vaapi] Could not set up subpicture palette\n");
++ free(palette);
++ palette = NULL;
++ }
++ return palette;
++}
++
++static void disable_osd(void)
++{
++ if (!va_osd_associated)
++ return;
++
++ vaDeassociateSubpicture(va_context->display,
++ va_osd_subpicture,
++ va_surface_ids, va_num_surfaces);
++
++ va_osd_associated = 0;
++}
++
++static int enable_osd(void)
++{
++ VAStatus status;
++
++ disable_osd();
++
++ status = vaAssociateSubpicture2(va_context->display,
++ va_osd_subpicture,
++ va_surface_ids, va_num_surfaces,
++ 0, 0,
++ va_osd_image.width, va_osd_image.height,
++ 0, 0,
++ g_image_width, g_image_height,
++ 0);
++ if (!check_status(status, "vaAssociateSubpicture()"))
++ return -1;
++
++ va_osd_associated = 1;
++ return 0;
++}
++
++static void destroy_osd(void)
++{
++ disable_osd();
++
++ if (va_osd_subpicture != VA_INVALID_ID) {
++ vaDestroySubpicture(va_context->display, va_osd_subpicture);
++ va_osd_subpicture = VA_INVALID_ID;
++ }
++
++ if (va_osd_image.image_id != VA_INVALID_ID) {
++ vaDestroyImage(va_context->display, va_osd_image.image_id);
++ va_osd_image.image_id = VA_INVALID_ID;
++ va_osd_image.width = 0;
++ va_osd_image.height = 0;
++ }
++}
++
++static void create_osd(void)
++{
++ VAStatus status;
++ int i, j;
++
++ for (i = 0; va_osd_info[i].format; i++) {
++ for (j = 0; j < va_num_subpic_formats; j++)
++ if (va_subpic_formats[j].fourcc == va_osd_info[i].format)
++ break;
++ if (j < va_num_subpic_formats &&
++ vaCreateImage(va_context->display, &va_subpic_formats[j],
++ g_output_rect.width, g_output_rect.height,
++ &va_osd_image) == VA_STATUS_SUCCESS) {
++ va_osd_palette = gen_osd_palette(&va_osd_image);
++ if (((!va_osd_image.num_palette_entries) ^ (!va_osd_palette)) == 0)
++ break;
++ vaDestroyImage(va_context->display, va_osd_image.image_id);
++ va_osd_image.image_id = VA_INVALID_ID;
++ }
++ }
++
++ if (va_osd_info[i].format &&
++ vaCreateSubpicture(va_context->display, va_osd_image.image_id,
++ &va_osd_subpicture) == VA_STATUS_SUCCESS) {
++ va_osd_draw_alpha = va_osd_info[i].draw_alpha;
++ if (va_osd_palette) {
++ status = vaSetImagePalette(va_context->display,
++ va_osd_image.image_id, va_osd_palette);
++ check_status(status, "vaSetImagePalette()");
++ }
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] Using %s surface for OSD\n",
++ string_of_VAImageFormat(&va_osd_image.format));
++ }
++}
++
++static void ensure_osd(void)
++{
++ if (g_output_rect.width == va_osd_image.width &&
++ g_output_rect.height == va_osd_image.height)
++ return;
++
++ destroy_osd();
++ create_osd();
++}
++
++static inline unsigned char *get_eosd_image_data(int x0, int y0)
++{
++ return (va_eosd_image_data +
++ va_eosd_image.offsets[0] +
++ va_eosd_image.pitches[0] * y0 +
++ x0 * ((va_eosd_image.format.bits_per_pixel + 7) / 8));
++}
++
++static void eosd_draw_alpha_bgra(unsigned char *src,
++ int src_w, int src_h, int src_stride,
++ int dst_x, int dst_y,
++ uint32_t color)
++{
++ int x, y;
++ const unsigned int dst_stride = va_eosd_image.pitches[0];
++ unsigned char *dst = get_eosd_image_data(dst_x, dst_y);
++ const unsigned int r = (color >> 24) & 0xff;
++ const unsigned int g = (color >> 16) & 0xff;
++ const unsigned int b = (color >> 8) & 0xff;
++ const unsigned int a = 0xff - (color & 0xff);
++
++ for (y = 0; y < src_h; y++, dst += dst_stride, src += src_stride)
++ for (x = 0; x < src_w; x++) {
++ const unsigned int v = src[x];
++ dst[4*x + 0] = (b * v + dst[4*x + 0] * (0xff - v)) / 255;
++ dst[4*x + 1] = (g * v + dst[4*x + 1] * (0xff - v)) / 255;
++ dst[4*x + 2] = (r * v + dst[4*x + 2] * (0xff - v)) / 255;
++ dst[4*x + 3] = (a * v + dst[4*x + 3] * (0xff - v)) / 255;
++ }
++}
++
++static void eosd_draw_alpha_rgba(unsigned char *src,
++ int src_w, int src_h, int src_stride,
++ int dst_x, int dst_y,
++ uint32_t color)
++{
++ int x, y;
++ const unsigned int dst_stride = va_eosd_image.pitches[0];
++ unsigned char *dst = get_eosd_image_data(dst_x, dst_y);
++ const unsigned int r = (color >> 24) & 0xff;
++ const unsigned int g = (color >> 16) & 0xff;
++ const unsigned int b = (color >> 8) & 0xff;
++ const unsigned int a = 0xff - (color & 0xff);
++
++ for (y = 0; y < src_h; y++, dst += dst_stride, src += src_stride)
++ for (x = 0; x < src_w; x++) {
++ const unsigned int v = src[x];
++ dst[4*x + 0] = (r * v + dst[4*x + 0] * (0xff - v)) / 255;
++ dst[4*x + 1] = (g * v + dst[4*x + 1] * (0xff - v)) / 255;
++ dst[4*x + 2] = (b * v + dst[4*x + 2] * (0xff - v)) / 255;
++ dst[4*x + 3] = (a * v + dst[4*x + 3] * (0xff - v)) / 255;
++ }
++}
++
++static void disable_eosd(void)
++{
++ if (!va_eosd_associated)
++ return;
++
++ vaDeassociateSubpicture(va_context->display,
++ va_eosd_subpicture,
++ va_surface_ids, va_num_surfaces);
++
++ va_eosd_associated = 0;
++}
++
++static int enable_eosd(void)
++{
++ VAStatus status;
++
++ if (va_eosd_associated)
++ return 0;
++
++ status = vaAssociateSubpicture2(va_context->display,
++ va_eosd_subpicture,
++ va_surface_ids, va_num_surfaces,
++ 0, 0, g_image_width, g_image_height,
++ 0, 0, g_image_width, g_image_height,
++ 0);
++ if (!check_status(status, "vaAssociateSubpicture()"))
++ return -1;
++
++ va_eosd_associated = 1;
++ return 0;
++}
++
++///< List of subpicture formats in preferred order
++static const struct {
++ uint32_t format;
++ eosd_draw_alpha_func draw_alpha;
++}
++va_eosd_info[] = {
++ { VA_FOURCC('B','G','R','A'), eosd_draw_alpha_bgra },
++ { VA_FOURCC('R','G','B','A'), eosd_draw_alpha_rgba },
++ { 0, NULL }
++};
++
++static int is_direct_mapping_init(void)
++{
++ VADisplayAttribute attr;
++ VAStatus status;
++
++ if (va_dm < 2)
++ return va_dm;
++
++ /* If the driver doesn't make a copy of the VA surface for
++ display, then we have to retain it until it's no longer the
++ visible surface. In other words, if the driver is using
++ DirectSurface mode, we don't want to decode the new surface
++ into the previous one that was used for display. */
++ attr.type = VADisplayAttribDirectSurface;
++ attr.flags = VA_DISPLAY_ATTRIB_GETTABLE;
++
++ status = vaGetDisplayAttributes(va_context->display, &attr, 1);
++ if (status == VA_STATUS_SUCCESS)
++ return !attr.value;
++ return 0;
++}
++
++static inline int is_direct_mapping(void)
++{
++ static int dm = -1;
++ if (dm < 0) {
++ dm = is_direct_mapping_init();
++ if (dm)
++ mp_msg(MSGT_VO, MSGL_INFO,
++ "[vo_vaapi] Using 1:1 VA surface mapping\n");
++ }
++ return dm;
++}
++
++static int int_012(int *n)
++{
++ return *n >= 0 && *n <= 2;
++}
++
++#if USE_VAAPI_SCALING
++static strarg_t g_scaling_arg = { 0, NULL };
++
++static int test_scaling_arg(void *arg)
++{
++ strarg_t * const strarg = arg;
++
++ return (strargcmp(strarg, "default") == 0 ||
++ strargcmp(strarg, "fast") == 0 ||
++ strargcmp(strarg, "hq") == 0);
++}
++
++static void setup_scaling(const char *scaling)
++{
++ if (strcmp(scaling, "default") == 0)
++ g_scaling = VA_FILTER_SCALING_DEFAULT;
++ else if (strcmp(scaling, "fast") == 0)
++ g_scaling = VA_FILTER_SCALING_FAST;
++ else if (strcmp(scaling, "hq") == 0)
++ g_scaling = VA_FILTER_SCALING_HQ;
++ else if (strcmp(scaling, "nla") == 0)
++ g_scaling = VA_FILTER_SCALING_NL_ANAMORPHIC;
++}
++#endif
++
++static const opt_t subopts[] = {
++ { "dm", OPT_ARG_INT, &va_dm, (opt_test_f)int_012 },
++ { "stats", OPT_ARG_BOOL, &cpu_stats, NULL },
++ { "deint", OPT_ARG_INT, &g_deint, (opt_test_f)int_012 },
++#if USE_VAAPI_COLORSPACE
++ { "colorspace", OPT_ARG_INT, &g_colorspace, (opt_test_f)int_012 },
++#endif
++#if USE_VAAPI_SCALING
++ { "scaling", OPT_ARG_STR, &g_scaling_arg, test_scaling_arg },
++#endif
++#if CONFIG_GL
++ { "gl", OPT_ARG_BOOL, &gl_enabled, NULL },
++ { "glfinish", OPT_ARG_BOOL, &gl_finish, NULL },
++#if USE_VAAPI_GLX_BIND
++ { "bind", OPT_ARG_BOOL, &gl_binding, NULL },
++#endif
++ { "reflect", OPT_ARG_BOOL, &gl_reflect, NULL },
++ { "tfp", OPT_ARG_BOOL, &gl_use_tfp, NULL },
++#endif
++#if CONFIG_XRENDER
++ { "xrender", OPT_ARG_BOOL, &xr_enabled, NULL },
++#endif
++ { NULL, }
++};
++
++static int preinit(const char *arg)
++{
++ VADisplayAttribute *display_attrs;
++ VAStatus status;
++ int va_major_version, va_minor_version;
++ int i, max_image_formats, max_subpic_formats, max_profiles;
++ int num_display_attrs, max_display_attrs;
++
++ va_dm = 2;
++ g_deint = 0;
++ g_deint_type = 2;
++ g_colorspace = 1;
++ g_scaling = 0;
++ if (subopt_parse(arg, subopts) != 0) {
++ mp_msg(MSGT_VO, MSGL_FATAL,
++ "\n-vo vaapi command line help:\n"
++ "Example: mplayer -vo vaapi:gl\n"
++ "\nOptions:\n"
++ " dm\n"
++ " 0: use least-recently-used VA surface\n"
++ " 1: identify VA surface with MPI index\n"
++ " 2: auto-detect use of direct surface mapping (default)\n"
++ " deint (all modes > 0 respect -field-dominance)\n"
++ " 0: no deinterlacing (default)\n"
++ " 1: only show first field\n"
++ " 2: bob deinterlacing\n"
++#if USE_VAAPI_COLORSPACE
++ " colorspace\n"
++ " 0: guess based on video resolution\n"
++ " 1: ITU-R BT.601 (default)\n"
++ " 2: ITU-R BT.709\n"
++ " 3: SMPTE-240M\n"
++#endif
++#if USE_VAAPI_SCALING
++ " scaling\n"
++ " default: use implementation default (default)\n"
++ " fast: use fast scaling, but possibly with less quality\n"
++ " hq: use high-quality scaling, but possibly slower\n"
++ " nla: use non-linear anamorphic scaling\n"
++#endif
++#if CONFIG_GL
++ " gl\n"
++ " Enable OpenGL rendering\n"
++ " glfinish\n"
++ " Call glFinish() before swapping buffers\n"
++ " tfp\n"
++ " Use GLX texture-from-pixmap instead of VA/GLX extensions\n"
++#if USE_VAAPI_GLX_BIND
++ " bind\n"
++ " Use VA surface binding instead of copy\n"
++#endif
++ " reflect\n"
++ " Enable OpenGL reflection effects\n"
++#endif
++#if CONFIG_XRENDER
++ " xrender\n"
++ " Enable Xrender rendering, thus vaPutSurface() to a Pixmap\n"
++#endif
++ "\n" );
++ return -1;
++ }
++ if (gl_enabled && xr_enabled) {
++ mp_msg(MSGT_VO, MSGL_ERR, "[vo_vaapi] User requested both Xrender and OpenGL rendering\n");
++ return -1;
++ }
++ if (g_deint)
++ g_deint_type = g_deint;
++#if CONFIG_GL
++ if (gl_enabled)
++ mp_msg(MSGT_VO, MSGL_INFO, "[vo_vaapi] Using OpenGL rendering%s\n",
++ gl_reflect ? ", with reflection effects" : "");
++#endif
++#if CONFIG_XRENDER
++ if (xr_enabled)
++ mp_msg(MSGT_VO, MSGL_INFO, "[vo_vaapi] Using Xrender rendering\n");
++#endif
++#if USE_VAAPI_SCALING
++ if (g_scaling_arg.str) {
++ mp_msg(MSGT_VO, MSGL_INFO, "[vo_vaapi] Using '%s' scaling\n", g_scaling_arg.str);
++ setup_scaling(g_scaling_arg.str);
++ }
++#endif
++
++ stats_init();
++
++#if CONFIG_GL
++ if (gl_enabled && !init_mpglcontext(&gl_context, GLTYPE_X11))
++ return -1;
++ else
++#endif
++ if (!vo_init())
++ return -1;
++#if CONFIG_XRENDER
++ if (xr_enabled && !init_xrender())
++ return -1;
++#endif
++
++ va_context = calloc(1, sizeof(*va_context));
++ if (!va_context)
++ return -1;
++
++#if CONFIG_VAAPI_GLX
++ if (gl_enabled)
++ va_context->display = vaGetDisplayGLX(mDisplay);
++ else
++#endif
++ va_context->display = vaGetDisplay(mDisplay);
++ if (!va_context->display)
++ return -1;
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] preinit(): VA display %p\n", va_context->display);
++
++ status = vaInitialize(va_context->display, &va_major_version, &va_minor_version);
++ if (!check_status(status, "vaInitialize()"))
++ return -1;
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] preinit(): VA API version %d.%d\n",
++ va_major_version, va_minor_version);
++
++ max_image_formats = vaMaxNumImageFormats(va_context->display);
++ va_image_formats = calloc(max_image_formats, sizeof(*va_image_formats));
++ if (!va_image_formats)
++ return -1;
++ status = vaQueryImageFormats(va_context->display, va_image_formats, &va_num_image_formats);
++ if (!check_status(status, "vaQueryImageFormats()"))
++ return -1;
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] preinit(): %d image formats available\n",
++ va_num_image_formats);
++ for (i = 0; i < va_num_image_formats; i++)
++ mp_msg(MSGT_VO, MSGL_DBG2, " %s\n", string_of_VAImageFormat(&va_image_formats[i]));
++
++ max_subpic_formats = vaMaxNumSubpictureFormats(va_context->display);
++ va_subpic_formats = calloc(max_subpic_formats, sizeof(*va_subpic_formats));
++ if (!va_subpic_formats)
++ return -1;
++ va_subpic_flags = calloc(max_subpic_formats, sizeof(*va_subpic_flags));
++ if (!va_subpic_flags)
++ return -1;
++ status = vaQuerySubpictureFormats(va_context->display, va_subpic_formats, va_subpic_flags, &va_num_subpic_formats);
++ if (!check_status(status, "vaQuerySubpictureFormats()"))
++ va_num_subpic_formats = 0; /* XXX: don't error out for IEGD */
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] preinit(): %d subpicture formats available\n",
++ va_num_subpic_formats);
++ for (i = 0; i < va_num_subpic_formats; i++)
++ mp_msg(MSGT_VO, MSGL_DBG2, " %s, flags 0x%x\n", string_of_VAImageFormat(&va_subpic_formats[i]), va_subpic_flags[i]);
++
++ max_profiles = vaMaxNumProfiles(va_context->display);
++ va_profiles = calloc(max_profiles, sizeof(*va_profiles));
++ if (!va_profiles)
++ return -1;
++ status = vaQueryConfigProfiles(va_context->display, va_profiles, &va_num_profiles);
++ if (!check_status(status, "vaQueryConfigProfiles()"))
++ return -1;
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] preinit(): %d profiles available\n",
++ va_num_profiles);
++ for (i = 0; i < va_num_profiles; i++)
++ mp_msg(MSGT_VO, MSGL_DBG2, " %s\n", string_of_VAProfile(va_profiles[i]));
++
++ va_osd_subpicture = VA_INVALID_ID;
++ va_osd_image.image_id = VA_INVALID_ID;
++ va_eosd_subpicture = VA_INVALID_ID;
++ va_eosd_image.image_id = VA_INVALID_ID;
++
++ max_display_attrs = vaMaxNumDisplayAttributes(va_context->display);
++ display_attrs = calloc(max_display_attrs, sizeof(*display_attrs));
++ if (display_attrs) {
++ num_display_attrs = 0;
++ status = vaQueryDisplayAttributes(va_context->display,
++ display_attrs, &num_display_attrs);
++ if (check_status(status, "vaQueryDisplayAttributes()")) {
++ for (i = 0; i < num_display_attrs; i++) {
++ VADisplayAttribute *attr;
++ switch (display_attrs[i].type) {
++ case VADisplayAttribBrightness:
++ attr = &va_equalizer.brightness;
++ break;
++ case VADisplayAttribContrast:
++ attr = &va_equalizer.contrast;
++ break;
++ case VADisplayAttribHue:
++ attr = &va_equalizer.hue;
++ break;
++ case VADisplayAttribSaturation:
++ attr = &va_equalizer.saturation;
++ break;
++ default:
++ attr = NULL;
++ break;
++ }
++ if (attr)
++ *attr = display_attrs[i];
++ }
++ }
++ free(display_attrs);
++ }
++ return 0;
++}
++
++static void free_video_specific(void)
++{
++ int i;
++
++#if CONFIG_VAAPI_GLX
++ if (gl_surface) {
++ VAStatus status;
++ status = vaDestroySurfaceGLX(va_context->display, gl_surface);
++ check_status(status, "vaDestroySurfaceGLX()");
++ gl_surface = NULL;
++ }
++#endif
++
++ if (va_context && va_context->context_id) {
++ vaDestroyContext(va_context->display, va_context->context_id);
++ va_context->context_id = 0;
++ }
++
++ if (va_free_surfaces) {
++ for (i = 0; i < va_num_surfaces; i++) {
++ if (!va_free_surfaces[i])
++ continue;
++ if (va_free_surfaces[i]->image.image_id != VA_INVALID_ID) {
++ vaDestroyImage(va_context->display,
++ va_free_surfaces[i]->image.image_id);
++ va_free_surfaces[i]->image.image_id = VA_INVALID_ID;
++ }
++ free(va_free_surfaces[i]);
++ va_free_surfaces[i] = NULL;
++ }
++ free(va_free_surfaces);
++ va_free_surfaces = NULL;
++ va_free_surfaces_head_index = 0;
++ va_free_surfaces_tail_index = 0;
++ }
++
++ g_output_surface = 0;
++ memset(g_output_surfaces, 0, sizeof(g_output_surfaces));
++
++ if (va_osd_palette) {
++ free(va_osd_palette);
++ va_osd_palette = NULL;
++ }
++
++ disable_eosd();
++ disable_osd();
++
++ if (va_eosd_subpicture != VA_INVALID_ID) {
++ vaDestroySubpicture(va_context->display, va_eosd_subpicture);
++ va_eosd_subpicture = VA_INVALID_ID;
++ }
++
++ if (va_eosd_image.image_id != VA_INVALID_ID) {
++ vaDestroyImage(va_context->display, va_eosd_image.image_id);
++ va_eosd_image.image_id = VA_INVALID_ID;
++ }
++
++ destroy_osd();
++
++ if (va_surface_ids) {
++ vaDestroySurfaces(va_context->display, va_surface_ids, va_num_surfaces);
++ free(va_surface_ids);
++ va_surface_ids = NULL;
++ va_num_surfaces = 0;
++ }
++
++ if (va_context && va_context->config_id) {
++ vaDestroyConfig(va_context->display, va_context->config_id);
++ va_context->config_id = 0;
++ }
++
++ if (va_entrypoints) {
++ free(va_entrypoints);
++ va_entrypoints = NULL;
++ }
++
++#if CONFIG_GL
++ if (gl_pixmap) {
++ x11_trap_errors();
++ mpglXDestroyPixmap(mDisplay, gl_pixmap);
++ XSync(mDisplay, False);
++ x11_untrap_errors();
++ gl_pixmap = None;
++ }
++
++ if (g_image_pixmap) {
++ XFreePixmap(mDisplay, g_image_pixmap);
++ g_image_pixmap = None;
++ }
++
++ if (gl_texture) {
++ glDeleteTextures(1, &gl_texture);
++ gl_texture = GL_NONE;
++ }
++#endif
++
++#if CONFIG_XRENDER
++ if (xr_window_picture) {
++ XRenderFreePicture(mDisplay, xr_window_picture);
++ xr_window_picture = None;
++ }
++#endif
++
++ g_is_visible = 0;
++}
++
++static void uninit(void)
++{
++ if (!vo_config_count)
++ return;
++
++ free_video_specific();
++
++ if (va_profiles) {
++ free(va_profiles);
++ va_profiles = NULL;
++ }
++
++ if (va_subpic_flags) {
++ free(va_subpic_flags);
++ va_subpic_flags = NULL;
++ }
++
++ if (va_subpic_formats) {
++ free(va_subpic_formats);
++ va_subpic_formats = NULL;
++ }
++
++ if (va_image_formats) {
++ free(va_image_formats);
++ va_image_formats = NULL;
++ }
++
++ if (va_context && va_context->display) {
++ vaTerminate(va_context->display);
++ va_context->display = NULL;
++ }
++
++ if (va_context) {
++ free(va_context);
++ va_context = NULL;
++ }
++
++#ifdef CONFIG_XF86VM
++ vo_vm_close();
++#endif
++#if CONFIG_XRENDER
++ if (xr_enabled)
++ uninit_xrender();
++#endif
++#if CONFIG_GL
++ if (gl_enabled)
++ uninit_mpglcontext(&gl_context);
++ else
++#endif
++ vo_x11_uninit();
++
++ stats_exit();
++}
++
++static int config_x11(uint32_t width, uint32_t height,
++ uint32_t display_width, uint32_t display_height,
++ uint32_t flags, char *title)
++{
++ Colormap cmap;
++ XVisualInfo visualInfo;
++ XVisualInfo *vi;
++ XSetWindowAttributes xswa;
++ unsigned long xswa_mask;
++ XWindowAttributes wattr;
++ int depth;
++
++#ifdef CONFIG_GUI
++ if (use_gui)
++ guiGetEvent(guiSetShVideo, 0); // the GUI will set up / resize our window
++ else
++#endif
++ {
++#ifdef CONFIG_XF86VM
++ if (flags & VOFLAG_MODESWITCHING)
++ vo_vm_switch();
++#endif
++ XGetWindowAttributes(mDisplay, DefaultRootWindow(mDisplay), &wattr);
++ depth = wattr.depth;
++ if (depth != 15 && depth != 16 && depth != 24 && depth != 32)
++ depth = 24;
++ XMatchVisualInfo(mDisplay, mScreen, depth, TrueColor, &visualInfo);
++
++#if CONFIG_GL
++ if (gl_enabled) {
++ vi = glXChooseVisual(mDisplay, mScreen, gl_visual_attr);
++ if (!vi)
++ return -1;
++ cmap = XCreateColormap(mDisplay, mRootWin, vi->visual, AllocNone);
++ if (cmap == None)
++ return -1;
++ }
++ else
++#endif
++ {
++ vi = &visualInfo;
++ XMatchVisualInfo(mDisplay, mScreen, depth, TrueColor, vi);
++ cmap = CopyFromParent;
++ }
++
++ vo_x11_create_vo_window(vi,
++ vo_dx, vo_dy, display_width, display_height,
++ flags, cmap, "vaapi", title);
++
++ if (vi != &visualInfo)
++ XFree(vi);
++
++ xswa_mask = CWBorderPixel | CWBackPixel;
++ xswa.border_pixel = 0;
++ xswa.background_pixel = 0;
++ XChangeWindowAttributes(mDisplay, vo_window, xswa_mask, &xswa);
++
++#ifdef CONFIG_XF86VM
++ if (flags & VOFLAG_MODESWITCHING) {
++ /* Grab the mouse pointer in our window */
++ if (vo_grabpointer)
++ XGrabPointer(mDisplay, vo_window, True, 0,
++ GrabModeAsync, GrabModeAsync,
++ vo_window, None, CurrentTime);
++ XSetInputFocus(mDisplay, vo_window, RevertToNone, CurrentTime);
++ }
++#endif
++ }
++ return 0;
++}
++
++#if CONFIG_GL
++static GLXFBConfig *get_fbconfig_for_depth(int depth)
++{
++ GLXFBConfig *fbconfigs, *ret = NULL;
++ int n_elements, i, found;
++ int db, stencil, alpha, mipmap, rgba, value;
++
++ static GLXFBConfig *cached_config = NULL;
++ static int have_cached_config = 0;
++
++ if (have_cached_config)
++ return cached_config;
++
++ fbconfigs = glXGetFBConfigs(mDisplay, mScreen, &n_elements);
++
++ db = SHRT_MAX;
++ stencil = SHRT_MAX;
++ mipmap = 0;
++ rgba = 0;
++
++ found = n_elements;
++
++ for (i = 0; i < n_elements; i++) {
++ XVisualInfo *vi;
++ int visual_depth;
++
++ vi = glXGetVisualFromFBConfig(mDisplay, fbconfigs[i]);
++ if (!vi)
++ continue;
++
++ visual_depth = vi->depth;
++ XFree(vi);
++
++ if (visual_depth != depth)
++ continue;
++
++ glXGetFBConfigAttrib(mDisplay, fbconfigs[i], GLX_ALPHA_SIZE, &alpha);
++ glXGetFBConfigAttrib(mDisplay, fbconfigs[i], GLX_BUFFER_SIZE, &value);
++ if (value != depth && (value - alpha) != depth)
++ continue;
++
++ value = 0;
++ if (depth == 32) {
++ glXGetFBConfigAttrib(mDisplay, fbconfigs[i],
++ GLX_BIND_TO_TEXTURE_RGBA_EXT, &value);
++ if (value)
++ rgba = 1;
++ }
++
++ if (!value) {
++ if (rgba)
++ continue;
++
++ glXGetFBConfigAttrib(mDisplay, fbconfigs[i],
++ GLX_BIND_TO_TEXTURE_RGB_EXT, &value);
++ if (!value)
++ continue;
++ }
++
++ glXGetFBConfigAttrib(mDisplay, fbconfigs[i], GLX_DOUBLEBUFFER, &value);
++ if (value > db)
++ continue;
++ db = value;
++
++ glXGetFBConfigAttrib(mDisplay, fbconfigs[i], GLX_STENCIL_SIZE, &value);
++ if (value > stencil)
++ continue;
++ stencil = value;
++
++ found = i;
++ }
++
++ if (found != n_elements) {
++ ret = malloc(sizeof(*ret));
++ *ret = fbconfigs[found];
++ }
++
++ if (n_elements)
++ XFree(fbconfigs);
++
++ have_cached_config = 1;
++ cached_config = ret;
++ return ret;
++}
++
++static int config_tfp(unsigned int width, unsigned int height)
++{
++ GLXFBConfig *fbconfig;
++ int attribs[7], i = 0;
++ const int depth = 24;
++
++ if (!mpglXBindTexImage || !mpglXReleaseTexImage) {
++ mp_msg(MSGT_VO, MSGL_ERR, "[vo_vaapi] No GLX texture-from-pixmap extension available\n");
++ return -1;
++ }
++
++ if (depth != 24 && depth != 32)
++ return -1;
++
++ g_image_pixmap = XCreatePixmap(mDisplay, vo_window, width, height, depth);
++ if (!g_image_pixmap) {
++ mp_msg(MSGT_VO, MSGL_ERR, "[vo_vaapi] Could not create X11 pixmap\n");
++ return -1;
++ }
++
++ fbconfig = get_fbconfig_for_depth(depth);
++ if (!fbconfig) {
++ mp_msg(MSGT_VO, MSGL_ERR, "[vo_vaapi] Could not find an FBConfig for 32-bit pixmap\n");
++ return -1;
++ }
++
++ attribs[i++] = GLX_TEXTURE_TARGET_EXT;
++ attribs[i++] = GLX_TEXTURE_2D_EXT;
++ attribs[i++] = GLX_TEXTURE_FORMAT_EXT;
++ if (depth == 24)
++ attribs[i++] = GLX_TEXTURE_FORMAT_RGB_EXT;
++ else if (depth == 32)
++ attribs[i++] = GLX_TEXTURE_FORMAT_RGBA_EXT;
++ attribs[i++] = GLX_MIPMAP_TEXTURE_EXT;
++ attribs[i++] = GL_FALSE;
++ attribs[i++] = None;
++
++ x11_trap_errors();
++ gl_pixmap = mpglXCreatePixmap(mDisplay, *fbconfig, g_image_pixmap, attribs);
++ XSync(mDisplay, False);
++ if (x11_untrap_errors()) {
++ mp_msg(MSGT_VO, MSGL_ERR, "[vo_vaapi] Could not create GLX pixmap\n");
++ return -1;
++ }
++ return 0;
++}
++
++static int config_glx(unsigned int width, unsigned int height)
++{
++ if (gl_context.setGlWindow(&gl_context) == SET_WINDOW_FAILED)
++ return -1;
++
++ glDisable(GL_DEPTH_TEST);
++ glDepthMask(GL_FALSE);
++ glDisable(GL_CULL_FACE);
++ glEnable(GL_TEXTURE_2D);
++ glDrawBuffer(vo_doublebuffering ? GL_BACK : GL_FRONT);
++ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
++ glEnable(GL_BLEND);
++ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
++
++ /* Create TFP resources */
++ if (gl_use_tfp && config_tfp(width, height) == 0)
++ mp_msg(MSGT_VO, MSGL_INFO, "[vo_vaapi] Using GLX texture-from-pixmap extension\n");
++ else
++ gl_use_tfp = 0;
++
++ /* Create OpenGL texture */
++ /* XXX: assume GL_ARB_texture_non_power_of_two is available */
++ glEnable(GL_TEXTURE_2D);
++ glGenTextures(1, &gl_texture);
++ mpglBindTexture(GL_TEXTURE_2D, gl_texture);
++ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
++ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
++ if (!gl_use_tfp) {
++ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
++ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
++ glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
++ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0,
++ GL_BGRA, GL_UNSIGNED_BYTE, NULL);
++ }
++ mpglBindTexture(GL_TEXTURE_2D, 0);
++ glDisable(GL_TEXTURE_2D);
++
++ glClearColor(0.0, 0.0, 0.0, 1.0);
++ glClear(GL_COLOR_BUFFER_BIT);
++
++ if (gl_build_font() < 0)
++ return -1;
++ return 0;
++}
++#endif
++
++#if CONFIG_XRENDER
++static XRenderPictFormat *get_xrender_argb32_format(void)
++{
++ static XRenderPictFormat *pictformat = NULL;
++ XRenderPictFormat templ;
++
++ const unsigned long mask =
++ PictFormatType |
++ PictFormatDepth |
++ PictFormatRed |
++ PictFormatRedMask |
++ PictFormatGreen |
++ PictFormatGreenMask |
++ PictFormatBlue |
++ PictFormatBlueMask |
++ PictFormatAlphaMask;
++
++ if (pictformat)
++ return pictformat;
++
++ /* First, look for a 32-bit format which ignores the alpha component */
++ templ.depth = 32;
++ templ.type = PictTypeDirect;
++ templ.direct.red = 16;
++ templ.direct.green = 8;
++ templ.direct.blue = 0;
++ templ.direct.redMask = 0xff;
++ templ.direct.greenMask = 0xff;
++ templ.direct.blueMask = 0xff;
++ templ.direct.alphaMask = 0;
++
++ pictformat = XRenderFindFormat(mDisplay, mask, &templ, 0);
++
++ if (!pictformat) {
++ /* Not all X servers support xRGB32 formats. However, the
++ * XRENDER spec says that they must support an ARGB32 format,
++ * so we can always return that.
++ */
++ pictformat = XRenderFindStandardFormat(mDisplay, PictStandardARGB32);
++ if (!pictformat)
++ mp_msg(MSGT_VO, MSGL_ERR, "XRENDER ARGB32 format not supported\n");
++ }
++ return pictformat;
++}
++
++static int create_xrender_specific(void)
++{
++ XRenderPictFormat *pictformat;
++
++ if (g_output_rect.width == 0 && g_output_rect.height == 0)
++ return 0;
++
++ g_image_pixmap = XCreatePixmap(mDisplay, vo_window, g_output_rect.width,
++ g_output_rect.height, 32);
++ if (!g_image_pixmap) {
++ mp_msg(MSGT_VO, MSGL_ERR, "Could not create video pixmap\n");
++ return -1;
++ }
++
++ pictformat = get_xrender_argb32_format();
++ if (!pictformat)
++ return -1;
++ xr_video_picture = XRenderCreatePicture(mDisplay, g_image_pixmap,
++ pictformat, 0, NULL);
++ if (!xr_video_picture) {
++ mp_msg(MSGT_VO, MSGL_ERR, "Could not create XRENDER backing picture for Pixmap\n");
++ return -1;
++ }
++ return 0;
++}
++
++static void free_xrender_specific(void)
++{
++ if (xr_video_picture) {
++ XRenderFreePicture(mDisplay, xr_video_picture);
++ xr_video_picture = None;
++ }
++
++ if (g_image_pixmap) {
++ XFreePixmap(mDisplay, g_image_pixmap);
++ g_image_pixmap = None;
++ }
++}
++
++static int reset_xrender_specific(void)
++{
++ free_xrender_specific();
++ return create_xrender_specific();
++}
++
++/* XXX: create a Pixmap as large as the display rect */
++static int config_xrender(unsigned int width, unsigned int height)
++{
++ XWindowAttributes wattr;
++ XRenderPictFormat *pictformat;
++
++ XGetWindowAttributes(mDisplay, vo_window, &wattr);
++ pictformat = XRenderFindVisualFormat(mDisplay, wattr.visual);
++ if (!pictformat) {
++ mp_msg(MSGT_VO, MSGL_ERR, "XRENDER does not support Window visual\n");
++ return -1;
++ }
++
++ xr_window_picture = XRenderCreatePicture(mDisplay, vo_window, pictformat,
++ 0, NULL);
++ if (!xr_window_picture) {
++ mp_msg(MSGT_VO, MSGL_ERR, "Could not create XRENDER backing picture for Window\n");
++ return -1;
++ }
++ return reset_xrender_specific();
++}
++#endif
++
++static int config_vaapi(uint32_t width, uint32_t height, uint32_t format)
++{
++ VAConfigAttrib attrib;
++ VAStatus status;
++ int i, j, profile, entrypoint, max_entrypoints, num_surfaces;
++
++ /* Create video surfaces */
++ if (!IMGFMT_IS_VAAPI(format))
++ num_surfaces = MAX_OUTPUT_SURFACES;
++ else {
++ switch (IMGFMT_VAAPI_CODEC(format)) {
++ case IMGFMT_VAAPI_CODEC_MPEG2:
++ num_surfaces = NUM_VIDEO_SURFACES_MPEG2;
++ break;
++ case IMGFMT_VAAPI_CODEC_MPEG4:
++ num_surfaces = NUM_VIDEO_SURFACES_MPEG4;
++ break;
++ case IMGFMT_VAAPI_CODEC_H264:
++ num_surfaces = NUM_VIDEO_SURFACES_H264;
++ break;
++ case IMGFMT_VAAPI_CODEC_VC1:
++ num_surfaces = NUM_VIDEO_SURFACES_VC1;
++ break;
++ default:
++ num_surfaces = 0;
++ break;
++ }
++ if (num_surfaces == 0)
++ return -1;
++ if (!is_direct_mapping())
++ num_surfaces = FFMIN(2 * num_surfaces, MAX_VIDEO_SURFACES);
++ }
++ for (i = 0; i < num_surfaces; i++) {
++ struct vaapi_surface *surface;
++ surface = alloc_vaapi_surface(width, height, VA_RT_FORMAT_YUV420);
++ if (!surface)
++ return -1;
++ }
++ assert(va_num_surfaces == num_surfaces);
++
++#if CONFIG_VAAPI_GLX
++ /* Create GLX surfaces */
++ if (gl_enabled && !gl_use_tfp) {
++ status = vaCreateSurfaceGLX(va_context->display,
++ GL_TEXTURE_2D, gl_texture,
++ &gl_surface);
++ if (!check_status(status, "vaCreateSurfaceGLX()"))
++ return -1;
++ }
++#endif
++
++ /* Create OSD data */
++ va_osd_draw_alpha = NULL;
++ va_osd_image.image_id = VA_INVALID_ID;
++ va_osd_image.buf = VA_INVALID_ID;
++ va_osd_subpicture = VA_INVALID_ID;
++ ensure_osd();
++
++ /* Create EOSD data */
++ va_eosd_draw_alpha = NULL;
++ va_eosd_image.image_id = VA_INVALID_ID;
++ va_eosd_image.buf = VA_INVALID_ID;
++ va_eosd_subpicture = VA_INVALID_ID;
++ for (i = 0; va_eosd_info[i].format; i++) {
++ for (j = 0; j < va_num_subpic_formats; j++)
++ if (va_subpic_formats[j].fourcc == va_eosd_info[i].format)
++ break;
++ if (j < va_num_subpic_formats &&
++ vaCreateImage(va_context->display, &va_subpic_formats[j],
++ width, height, &va_eosd_image) == VA_STATUS_SUCCESS)
++ break;
++ }
++ if (va_eosd_info[i].format &&
++ vaCreateSubpicture(va_context->display, va_eosd_image.image_id,
++ &va_eosd_subpicture) == VA_STATUS_SUCCESS) {
++ va_eosd_draw_alpha = va_eosd_info[i].draw_alpha;
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] Using %s surface for EOSD\n",
++ string_of_VAImageFormat(&va_eosd_image.format));
++ }
++
++ /* Allocate VA images */
++ if (!IMGFMT_IS_VAAPI(format)) {
++ VAImageFormat *image_format = VAImageFormat_from_imgfmt(format);
++ if (!image_format)
++ return -1;
++ for (i = 0; i < va_num_surfaces; i++) {
++ struct vaapi_surface * const s = va_free_surfaces[i];
++ s->is_bound = 0;
++ status = vaDeriveImage(va_context->display, s->id, &s->image);
++ if (status == VA_STATUS_SUCCESS) {
++ /* vaDeriveImage() is supported, check format */
++ if (s->image.format.fourcc != image_format->fourcc) {
++ vaDestroyImage(va_context->display, s->image.image_id);
++ return -1;
++ }
++ if (s->image.width == width && s->image.height == height) {
++ s->is_bound = 1;
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] Using vaDeriveImage()\n");
++ }
++ else {
++ vaDestroyImage(va_context->display, s->image.image_id);
++ status = VA_STATUS_ERROR_OPERATION_FAILED;
++ }
++
++ }
++ if (status != VA_STATUS_SUCCESS) {
++ status = vaCreateImage(va_context->display, image_format,
++ width, height, &s->image);
++ if (!check_status(status, "vaCreateImage()"))
++ return -1;
++ }
++ }
++ return 0;
++ }
++
++ /* Check profile */
++ profile = VAProfile_from_imgfmt(format);
++ if (profile < 0)
++ return -1;
++
++ /* Check entry-point (only VLD for now) */
++ max_entrypoints = vaMaxNumEntrypoints(va_context->display);
++ va_entrypoints = calloc(max_entrypoints, sizeof(*va_entrypoints));
++ if (!va_entrypoints)
++ return -1;
++
++ status = vaQueryConfigEntrypoints(va_context->display, profile,
++ va_entrypoints, &va_num_entrypoints);
++ if (!check_status(status, "vaQueryConfigEntrypoints()"))
++ return -1;
++
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] config_vaapi(%s): %d entrypoints available\n",
++ string_of_VAProfile(profile), va_num_entrypoints);
++ for (i = 0; i < va_num_entrypoints; i++)
++ mp_msg(MSGT_VO, MSGL_DBG2, " %s\n", string_of_VAEntrypoint(va_entrypoints[i]));
++
++ entrypoint = VAEntrypoint_from_imgfmt(format);
++ if (entrypoint != VAEntrypointVLD)
++ return -1;
++
++ /* Check chroma format (only 4:2:0 for now) */
++ attrib.type = VAConfigAttribRTFormat;
++ status = vaGetConfigAttributes(va_context->display, profile, entrypoint, &attrib, 1);
++ if (!check_status(status, "vaGetConfigAttributes()"))
++ return -1;
++ if ((attrib.value & VA_RT_FORMAT_YUV420) == 0)
++ return -1;
++
++ /* Create a configuration for the decode pipeline */
++ status = vaCreateConfig(va_context->display, profile, entrypoint, &attrib, 1, &va_context->config_id);
++ if (!check_status(status, "vaCreateConfig()"))
++ return -1;
++
++ /* Create a context for the decode pipeline */
++ status = vaCreateContext(va_context->display, va_context->config_id,
++ width, height, VA_PROGRESSIVE,
++ va_surface_ids, va_num_surfaces,
++ &va_context->context_id);
++ if (!check_status(status, "vaCreateContext()"))
++ return -1;
++ return 0;
++}
++
++static int config(uint32_t width, uint32_t height,
++ uint32_t display_width, uint32_t display_height,
++ uint32_t flags, char *title, uint32_t format)
++{
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] config(): size %dx%d, display size %dx%d, flags %x, title '%s', format %x (%s)\n",
++ width, height, display_width, display_height, flags, title, format, vo_format_name(format));
++
++ free_video_specific();
++
++ if (config_x11(width, height, display_width, display_height, flags, title) < 0)
++ return -1;
++
++#if CONFIG_GL
++ if (gl_enabled && config_glx(width, height) < 0)
++ return -1;
++#endif
++
++#if CONFIG_XRENDER
++ if (xr_enabled && config_xrender(width, height) < 0)
++ return -1;
++#endif
++
++ if (config_vaapi(width, height, format) < 0)
++ return -1;
++
++ g_is_visible = 0;
++ g_is_paused = 0;
++ g_image_width = width;
++ g_image_height = height;
++ g_image_format = format;
++ resize();
++ return 0;
++}
++
++static int query_format(uint32_t format)
++{
++ const int default_caps = (VFCAP_CSP_SUPPORTED |
++ VFCAP_CSP_SUPPORTED_BY_HW |
++ VFCAP_HWSCALE_UP |
++ VFCAP_HWSCALE_DOWN |
++ VFCAP_OSD |
++ VFCAP_EOSD);
++
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] query_format(): format %x (%s)\n",
++ format, vo_format_name(format));
++
++ switch (format) {
++ case IMGFMT_VAAPI_MPEG2:
++ case IMGFMT_VAAPI_MPEG4:
++ case IMGFMT_VAAPI_H263:
++ case IMGFMT_VAAPI_H264:
++ case IMGFMT_VAAPI_WMV3:
++ case IMGFMT_VAAPI_VC1:
++ return default_caps | VOCAP_NOSLICES;
++ case IMGFMT_NV12:
++ case IMGFMT_YV12:
++ case IMGFMT_I420:
++ case IMGFMT_IYUV:
++ if (VAImageFormat_from_imgfmt(format))
++ return default_caps;
++ break;
++ }
++ return 0;
++}
++
++static inline int get_field_flags(int i)
++{
++ return (g_deint && (g_image_fields & MP_IMGFIELD_INTERLACED) ?
++ (((!!(g_image_fields & MP_IMGFIELD_TOP_FIRST)) ^ i) == 0 ?
++ VA_BOTTOM_FIELD : VA_TOP_FIELD) : VA_FRAME_PICTURE);
++}
++
++static inline int get_colorspace_flags(void)
++{
++ int csp = 0;
++#if USE_VAAPI_COLORSPACE
++ switch (g_colorspace) {
++ case 0:
++ csp = ((g_image_width >= 1280 || g_image_height > 576) ?
++ VA_SRC_BT709 : VA_SRC_BT601);
++ break;
++ case 1:
++ csp = VA_SRC_BT601;
++ break;
++ case 2:
++ csp = VA_SRC_BT709;
++ break;
++ case 3:
++ csp = VA_SRC_SMPTE_240;
++ break;
++ default:
++ assert(0);
++ break;
++ }
++#endif
++ return csp;
++}
++
++static void put_surface_x11(struct vaapi_surface *surface)
++{
++ VAStatus status;
++ int i;
++
++ for (i = 0; i <= !!(g_deint > 1); i++) {
++ const unsigned int flags = (get_field_flags(i) |
++ get_colorspace_flags() |
++ g_scaling);
++ status = vaPutSurface(va_context->display,
++ surface->id,
++ vo_window,
++ 0, 0, g_image_width, g_image_height,
++ g_output_rect.left,
++ g_output_rect.top,
++ g_output_rect.width,
++ g_output_rect.height,
++ NULL, 0,
++ flags);
++ if (!check_status(status, "vaPutSurface()"))
++ return;
++ }
++}
++
++#if CONFIG_GL
++static void put_surface_glx(struct vaapi_surface *surface)
++{
++ VAStatus status;
++ int i;
++
++ if (gl_use_tfp) {
++ for (i = 0; i <= !!(g_deint > 1); i++) {
++ const unsigned int flags = (get_field_flags(i) |
++ get_colorspace_flags() |
++ g_scaling);
++ status = vaPutSurface(va_context->display,
++ surface->id,
++ g_image_pixmap,
++ 0, 0, g_image_width, g_image_height,
++ 0, 0, g_image_width, g_image_height,
++ NULL, 0,
++ flags);
++ if (!check_status(status, "vaPutSurface()"))
++ return;
++ }
++ g_output_surfaces[g_output_surface] = surface;
++ return;
++ }
++
++#if CONFIG_VAAPI_GLX
++ if (gl_binding) {
++#if USE_VAAPI_GLX_BIND
++ for (i = 0; i <= !!(g_deint > 1); i++) {
++ const unsigned int flags = (get_field_flags(i) |
++ get_colorspace_flags() |
++ g_scaling);
++ status = vaAssociateSurfaceGLX(va_context->display,
++ gl_surface,
++ surface->id,
++ flags);
++ if (!check_status(status, "vaAssociateSurfaceGLX()"))
++ return;
++ }
++#else
++ mp_msg(MSGT_VO, MSGL_WARN, "vaAssociateSurfaceGLX() is not implemented\n");
++ gl_binding = 0;
++#endif
++ }
++
++ if (!gl_binding) {
++ for (i = 0; i <= !!(g_deint > 1); i++) {
++ const unsigned int flags = (get_field_flags(i) |
++ get_colorspace_flags() |
++ g_scaling);
++ status = vaCopySurfaceGLX(va_context->display,
++ gl_surface,
++ surface->id,
++ flags);
++
++ if (status == VA_STATUS_ERROR_UNIMPLEMENTED) {
++ mp_msg(MSGT_VO, MSGL_WARN,
++ "[vo_vaapi] vaCopySurfaceGLX() is not implemented\n");
++ gl_binding = 1;
++ }
++ else {
++ if (!check_status(status, "vaCopySurfaceGLX()"))
++ return;
++ }
++ }
++ }
++#endif
++ g_output_surfaces[g_output_surface] = surface;
++}
++
++static int glx_bind_texture(void)
++{
++ glEnable(GL_TEXTURE_2D);
++ mpglBindTexture(GL_TEXTURE_2D, gl_texture);
++
++ if (gl_use_tfp) {
++ x11_trap_errors();
++ mpglXBindTexImage(mDisplay, gl_pixmap, GLX_FRONT_LEFT_EXT, NULL);
++ XSync(mDisplay, False);
++ if (x11_untrap_errors())
++ mp_msg(MSGT_VO, MSGL_WARN, "[vo_vaapi] Update bind_tex_image failed\n");
++ }
++
++#if USE_VAAPI_GLX_BIND
++ if (gl_binding) {
++ VAStatus status;
++ status = vaBeginRenderSurfaceGLX(va_context->display, gl_surface);
++ if (!check_status(status, "vaBeginRenderSurfaceGLX()"))
++ return -1;
++ }
++#endif
++ return 0;
++}
++
++static int glx_unbind_texture(void)
++{
++ if (gl_use_tfp) {
++ x11_trap_errors();
++ mpglXReleaseTexImage(mDisplay, gl_pixmap, GLX_FRONT_LEFT_EXT);
++ if (x11_untrap_errors())
++ mp_msg(MSGT_VO, MSGL_WARN, "[vo_vaapi] Failed to release?\n");
++ }
++
++#if USE_VAAPI_GLX_BIND
++ if (gl_binding) {
++ VAStatus status;
++ status = vaEndRenderSurfaceGLX(va_context->display, gl_surface);
++ if (!check_status(status, "vaEndRenderSurfaceGLX()"))
++ return -1;
++ }
++#endif
++
++ mpglBindTexture(GL_TEXTURE_2D, 0);
++ glDisable(GL_TEXTURE_2D);
++ return 0;
++}
++
++static void render_background(void)
++{
++ /* Original code from Mirco Muller (MacSlow):
++ <http://cgit.freedesktop.org/~macslow/gl-gst-player/> */
++ GLfloat fStartX = 0.0f;
++ GLfloat fStartY = 0.0f;
++ GLfloat fWidth = (GLfloat)vo_dwidth;
++ GLfloat fHeight = (GLfloat)vo_dheight;
++
++ glBegin(GL_QUADS);
++ {
++ /* top third, darker grey to white */
++ glColor3f(0.85f, 0.85f, 0.85f);
++ glVertex3f(fStartX, fStartY, 0.0f);
++ glColor3f(0.85f, 0.85f, 0.85f);
++ glVertex3f(fStartX + fWidth, fStartY, 0.0f);
++ glColor3f(1.0f, 1.0f, 1.0f);
++ glVertex3f(fStartX + fWidth, fStartY + fHeight / 3.0f, 0.0f);
++ glColor3f(1.0f, 1.0f, 1.0f);
++ glVertex3f(fStartX, fStartY + fHeight / 3.0f, 0.0f);
++
++ /* middle third, just plain white */
++ glColor3f(1.0f, 1.0f, 1.0f);
++ glVertex3f(fStartX, fStartY + fHeight / 3.0f, 0.0f);
++ glVertex3f(fStartX + fWidth, fStartY + fHeight / 3.0f, 0.0f);
++ glVertex3f(fStartX + fWidth, fStartY + 2.0f * fHeight / 3.0f, 0.0f);
++ glVertex3f(fStartX, fStartY + 2.0f * fHeight / 3.0f, 0.0f);
++
++ /* bottom third, white to lighter grey */
++ glColor3f(1.0f, 1.0f, 1.0f);
++ glVertex3f(fStartX, fStartY + 2.0f * fHeight / 3.0f, 0.0f);
++ glColor3f(1.0f, 1.0f, 1.0f);
++ glVertex3f(fStartX + fWidth, fStartY + 2.0f * fHeight / 3.0f, 0.0f);
++ glColor3f(0.62f, 0.66f, 0.69f);
++ glVertex3f(fStartX + fWidth, fStartY + fHeight, 0.0f);
++ glColor3f(0.62f, 0.66f, 0.69f);
++ glVertex3f(fStartX, fStartY + fHeight, 0.0f);
++ }
++ glEnd();
++}
++
++static void render_frame(void)
++{
++ struct vo_rect * const r = &g_output_rect;
++
++ if (glx_bind_texture() < 0)
++ return;
++ glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
++ glBegin(GL_QUADS);
++ {
++ glTexCoord2f(0.0f, 0.0f); glVertex2i(r->left, r->top);
++ glTexCoord2f(0.0f, 1.0f); glVertex2i(r->left, r->bottom);
++ glTexCoord2f(1.0f, 1.0f); glVertex2i(r->right, r->bottom);
++ glTexCoord2f(1.0f, 0.0f); glVertex2i(r->right, r->top);
++ }
++ glEnd();
++ if (glx_unbind_texture() < 0)
++ return;
++}
++
++static void render_reflection(void)
++{
++ struct vo_rect * const r = &g_output_rect;
++ const unsigned int rh = g_output_rect.height / 5;
++ GLfloat ry = 1.0f - (GLfloat)rh / (GLfloat)r->height;
++
++ if (glx_bind_texture() < 0)
++ return;
++ glBegin(GL_QUADS);
++ {
++ glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
++ glTexCoord2f(0.0f, 1.0f); glVertex2i(r->left, r->top);
++ glTexCoord2f(1.0f, 1.0f); glVertex2i(r->right, r->top);
++
++ glColor4f(1.0f, 1.0f, 1.0f, 0.0f);
++ glTexCoord2f(1.0f, ry); glVertex2i(r->right, r->top + rh);
++ glTexCoord2f(0.0f, ry); glVertex2i(r->left, r->top + rh);
++ }
++ glEnd();
++ if (glx_unbind_texture() < 0)
++ return;
++}
++
++static void flip_page_glx(void)
++{
++ glClear(GL_COLOR_BUFFER_BIT);
++
++ if (gl_reflect) {
++ render_background();
++
++ glPushMatrix();
++ glRotatef(20.0f, 0.0f, 1.0f, 0.0f);
++ glTranslatef(50.0f, 0.0f, 0.0f);
++ }
++
++ render_frame();
++
++ if (gl_reflect) {
++ glPushMatrix();
++ glTranslatef(0.0, (GLfloat)g_output_rect.height + 5.0f, 0.0f);
++ render_reflection();
++ glPopMatrix();
++ glPopMatrix();
++ }
++
++ if (cpu_stats) {
++ gl_draw_rectangle(0, 0, vo_dwidth, 32, 0x000000ff);
++ glColor3f(1.0f, 1.0f, 1.0f);
++ glRasterPos2i(16, 20);
++ gl_printf("MPlayer: %.1f%% of CPU @ %u MHz", cpu_usage, cpu_frequency);
++ }
++
++ if (gl_finish)
++ mpglFinish();
++ gl_context.swapGlBuffers(&gl_context);
++
++ if (vo_fs) /* avoid flickering borders in fullscreen mode */
++ glClear(GL_COLOR_BUFFER_BIT);
++}
++#endif
++
++#if CONFIG_XRENDER
++static void put_surface_xrender(struct vaapi_surface *surface)
++{
++ VAStatus status;
++ int i;
++
++ for (i = 0; i <= !!(g_deint > 1); i++) {
++ const unsigned int flags = (get_field_flags(i) |
++ get_colorspace_flags() |
++ g_scaling);
++ status = vaPutSurface(va_context->display,
++ surface->id,
++ g_image_pixmap,
++ 0, 0, g_image_width, g_image_height,
++ 0, 0, g_output_rect.width, g_output_rect.height,
++ NULL, 0,
++ flags);
++ if (!check_status(status, "vaPutSurface()"))
++ return;
++ XRenderComposite(mDisplay,
++ PictOpSrc, xr_video_picture, 0, xr_window_picture,
++ 0, 0,
++ 0, 0,
++ g_output_rect.left, g_output_rect.top,
++ g_output_rect.width, g_output_rect.height);
++ }
++}
++#endif
++
++static void put_surface(struct vaapi_surface *surface)
++{
++ if (!surface || surface->id == VA_INVALID_SURFACE)
++ return;
++
++#if CONFIG_GL
++ if (gl_enabled)
++ put_surface_glx(surface);
++ else
++#endif
++#if CONFIG_XRENDER
++ if (xr_enabled)
++ put_surface_xrender(surface);
++ else
++#endif
++ put_surface_x11(surface);
++}
++
++static int draw_slice(uint8_t * image[], int stride[],
++ int w, int h, int x, int y)
++{
++ struct vaapi_surface * const surface = va_free_surfaces[g_output_surface];
++ VAImage * const va_image = &surface->image;
++ VAStatus status;
++ uint8_t *image_data = NULL;
++ uint8_t *dst[3] = { 0, };
++ unsigned int dst_stride[3];
++
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] draw_slice(): location (%d,%d), size %dx%d\n", x, y, w, h);
++
++ status = vaMapBuffer(va_context->display, va_image->buf,
++ (void *)&image_data);
++ if (!check_status(status, "vaMapBuffer()"))
++ return VO_FALSE;
++
++ dst_stride[0] = va_image->pitches[0];
++ dst[0] = image_data + va_image->offsets[0] + y * dst_stride[0] + x;
++
++ memcpy_pic(dst[0], image[0], w, h, dst_stride[0], stride[0]);
++
++ x /= 2;
++ y /= 2;
++ w /= 2;
++ h /= 2;
++
++ if (g_image_format == IMGFMT_YV12) {
++ /* MPlayer's YV12 is actually I420, so swap U/V components */
++ dst_stride[1] = va_image->pitches[2];
++ dst[1] = image_data + va_image->offsets[2] + y * dst_stride[1] + x;
++ dst_stride[2] = va_image->pitches[1];
++ dst[2] = image_data + va_image->offsets[1] + y * dst_stride[2] + x;
++ }
++ else {
++ if (image[1]) {
++ dst_stride[1] = va_image->pitches[1];
++ dst[1] = image_data + va_image->offsets[1] + y * dst_stride[1] + x;
++ }
++ if (image[2]) {
++ dst_stride[2] = va_image->pitches[2];
++ dst[2] = image_data + va_image->offsets[2] + y * dst_stride[2] + x;
++ }
++ }
++
++ if (image[1]) /* RGBA only has a single plane */
++ memcpy_pic(dst[1], image[1], w, h, dst_stride[1], stride[1]);
++
++ if (image[2]) /* NV12 only has two planes */
++ memcpy_pic(dst[2], image[2], w, h, dst_stride[2], stride[2]);
++
++ status = vaUnmapBuffer(va_context->display, surface->image.buf);
++ if (!check_status(status, "vaUnmapBuffer()"))
++ return VO_FALSE;
++
++ return VO_TRUE;
++}
++
++static int draw_frame(uint8_t * src[])
++{
++ mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_X11_DrawFrameCalled);
++
++ return -1;
++}
++
++static void draw_osd(void)
++{
++ VAStatus status;
++ const int osd_width = va_osd_image.width;
++ const int osd_height = va_osd_image.height;
++
++ ensure_osd();
++ if (va_osd_image.image_id == VA_INVALID_ID)
++ return;
++
++ if (!va_osd_draw_alpha)
++ return;
++
++ if (!vo_update_osd(osd_width, osd_height))
++ return;
++
++ if (!vo_osd_check_range_update(0, 0, osd_width, osd_height)) {
++ disable_osd();
++ return;
++ }
++
++ status = vaMapBuffer(va_context->display, va_osd_image.buf,
++ (void *)&va_osd_image_data);
++ if (!check_status(status, "vaMapBuffer()"))
++ return;
++
++ memset(va_osd_image_data, 0, va_osd_image.data_size);
++
++ vo_draw_text(osd_width, osd_height, va_osd_draw_alpha);
++
++ status = vaUnmapBuffer(va_context->display, va_osd_image.buf);
++ if (!check_status(status, "vaUnmapBuffer()"))
++ return;
++ va_osd_image_data = NULL;
++
++ enable_osd();
++}
++
++static void draw_eosd(struct mp_eosd_image_list *imgs)
++{
++ struct mp_eosd_image *img = eosd_image_first(imgs);
++ struct mp_eosd_image *i;
++ VAStatus status;
++
++ if (!va_eosd_draw_alpha)
++ return;
++
++ // Nothing changed, no need to redraw
++ if (imgs->changed == 0)
++ return;
++
++ // There's nothing to render!
++ if (!img) {
++ disable_eosd();
++ return;
++ }
++
++ if (imgs->changed == 1)
++ goto eosd_skip_upload;
++
++ status = vaMapBuffer(va_context->display, va_eosd_image.buf,
++ (void *)&va_eosd_image_data);
++ if (!check_status(status, "vaMapBuffer()"))
++ return;
++
++ memset(va_eosd_image_data, 0, va_eosd_image.data_size);
++
++ for (i = img; i; i = i->next)
++ va_eosd_draw_alpha(i->bitmap, i->w, i->h, i->stride,
++ i->dst_x, i->dst_y, i->color);
++
++ status = vaUnmapBuffer(va_context->display, va_eosd_image.buf);
++ if (!check_status(status, "vaUnmapBuffer()"))
++ return;
++ va_eosd_image_data = NULL;
++
++eosd_skip_upload:
++ enable_eosd();
++}
++
++static void flip_page(void)
++{
++ struct vaapi_surface *surface;
++
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] flip_page()\n");
++
++ surface = g_output_surfaces[g_output_surface];
++ if (!surface)
++ return;
++
++ put_surface(surface);
++ g_output_surface = (g_output_surface + 1) % MAX_OUTPUT_SURFACES;
++ g_is_visible = 1;
++
++#if CONFIG_GL
++ if (gl_enabled)
++ flip_page_glx();
++#endif
++}
++
++static struct vaapi_surface *get_surface(mp_image_t *mpi)
++{
++ struct vaapi_surface *surface;
++
++ if (mpi->type == MP_IMGTYPE_NUMBERED && is_direct_mapping()) {
++ assert(mpi->number < va_num_surfaces);
++ surface = va_free_surfaces[mpi->number];
++ return surface;
++ }
++
++ /* Push current surface to a free slot */
++ if (mpi->priv) {
++ assert(!va_free_surfaces[va_free_surfaces_tail_index]);
++ va_free_surfaces[va_free_surfaces_tail_index] = mpi->priv;
++ va_free_surfaces_tail_index = (va_free_surfaces_tail_index + 1) % va_num_surfaces;
++ }
++
++ /* Pop the least recently used free surface */
++ assert(va_free_surfaces[va_free_surfaces_head_index]);
++ surface = va_free_surfaces[va_free_surfaces_head_index];
++ va_free_surfaces[va_free_surfaces_head_index] = NULL;
++ va_free_surfaces_head_index = (va_free_surfaces_head_index + 1) % va_num_surfaces;
++ return surface;
++}
++
++static uint32_t get_image(mp_image_t *mpi)
++{
++ struct vaapi_surface *surface;
++
++ if (mpi->type != MP_IMGTYPE_NUMBERED)
++ return VO_FALSE;
++
++ if (!IMGFMT_IS_VAAPI(g_image_format))
++ return VO_FALSE;
++
++ surface = get_surface(mpi);
++ if (!surface)
++ return VO_FALSE;
++
++ mpi->flags |= MP_IMGFLAG_DIRECT;
++ mpi->stride[0] = mpi->stride[1] = mpi->stride[2] = mpi->stride[3] = 0;
++ mpi->planes[0] = mpi->planes[1] = mpi->planes[2] = mpi->planes[3] = NULL;
++ mpi->planes[0] = (char *)surface;
++ mpi->planes[3] = (char *)(uintptr_t)surface->id;
++ mpi->num_planes = 1;
++ mpi->priv = surface;
++
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] get_image(): surface 0x%08x\n", surface->id);
++
++ return VO_TRUE;
++}
++
++static int put_image(mp_image_t *mpi, struct vaapi_surface *surface)
++{
++ VAStatus status;
++
++ if ((mpi->flags & (MP_IMGFLAG_PLANAR|MP_IMGFLAG_YUV)) != (MP_IMGFLAG_PLANAR|MP_IMGFLAG_YUV))
++ return VO_FALSE;
++
++ if (!(mpi->flags & MP_IMGFLAG_DRAW_CALLBACK)) {
++ if (!draw_slice(mpi->planes, mpi->stride, mpi->w, mpi->h, 0, 0))
++ return VO_FALSE;
++ }
++
++ if (!surface->is_bound) {
++ status = vaPutImage2(va_context->display,
++ surface->id,
++ surface->image.image_id,
++ mpi->x, mpi->y, mpi->w, mpi->h,
++ mpi->x, mpi->y, mpi->w, mpi->h);
++ if (!check_status(status, "vaPutImage()"))
++ return VO_FALSE;
++ }
++
++ return VO_TRUE;
++}
++
++static uint32_t draw_image(mp_image_t *mpi)
++{
++ struct vaapi_surface *surface = (struct vaapi_surface *)mpi->priv;
++
++ g_image_fields = mpi->fields;
++
++ if (!IMGFMT_IS_VAAPI(mpi->imgfmt)) {
++ /* XXX: no direct rendering in non-accelerated mode */
++ surface = va_free_surfaces[g_output_surface];
++ if (!put_image(mpi, surface))
++ return VO_FALSE;
++ }
++
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] draw_image(): surface 0x%08x\n", surface->id);
++
++ g_output_surfaces[g_output_surface] = surface;
++
++ if (cpu_stats) {
++ static uint64_t ticks;
++ if ((ticks++ % 30) == 0) {
++ cpu_frequency = get_cpu_frequency();
++ cpu_usage = get_cpu_usage(CPU_USAGE_QUANTUM);
++ }
++ }
++ return VO_TRUE;
++}
++
++static void check_events(void)
++{
++ int events = vo_x11_check_events(mDisplay);
++
++ if (events & VO_EVENT_RESIZE)
++ resize();
++
++ if ((events & (VO_EVENT_EXPOSE|VO_EVENT_RESIZE)) && g_is_paused) {
++ /* Redraw the last visible buffer */
++ if (g_is_visible) {
++ struct vaapi_surface *surface = g_output_surfaces[g_output_surface];
++ if (surface)
++ put_surface(surface);
++ }
++ }
++}
++
++static VADisplayAttribute *get_display_attribute(const char *name)
++{
++ VADisplayAttribute *attr;
++ if (!strcasecmp(name, "brightness"))
++ attr = &va_equalizer.brightness;
++ else if (!strcasecmp(name, "contrast"))
++ attr = &va_equalizer.contrast;
++ else if (!strcasecmp(name, "saturation"))
++ attr = &va_equalizer.saturation;
++ else if (!strcasecmp(name, "hue"))
++ attr = &va_equalizer.hue;
++ else
++ attr = NULL;
++ return attr;
++}
++
++static int get_equalizer(const char *name, int *value)
++{
++ VADisplayAttribute * const attr = get_display_attribute(name);
++ int r;
++
++ if (!attr || !(attr->flags & VA_DISPLAY_ATTRIB_GETTABLE))
++ return VO_NOTIMPL;
++
++ /* normalize to -100 .. 100 range */
++ r = attr->max_value - attr->min_value;
++ if (r == 0)
++ return VO_NOTIMPL;
++ *value = ((attr->value - attr->min_value) * 200) / r - 100;
++ return VO_TRUE;
++}
++
++static int set_equalizer(const char *name, int value)
++{
++ VADisplayAttribute * const attr = get_display_attribute(name);
++ VAStatus status;
++ int r;
++
++ if (!attr || !(attr->flags & VA_DISPLAY_ATTRIB_SETTABLE))
++ return VO_NOTIMPL;
++
++ /* normalize to attribute value range */
++ r = attr->max_value - attr->min_value;
++ if (r == 0)
++ return VO_NOTIMPL;
++ attr->value = ((value + 100) * r) / 200 + attr->min_value;
++
++ status = vaSetDisplayAttributes(va_context->display, attr, 1);
++ if (!check_status(status, "vaSetDisplayAttributes()"))
++ return VO_FALSE;
++ return VO_TRUE;
++}
++
++static int control(uint32_t request, void *data)
++{
++ switch (request) {
++ case VOCTRL_GET_DEINTERLACE:
++ *(int*)data = g_deint;
++ return VO_TRUE;
++ case VOCTRL_SET_DEINTERLACE:
++ g_deint = *(int*)data;
++ if (g_deint)
++ g_deint = g_deint_type;
++ return VO_TRUE;
++ case VOCTRL_PAUSE:
++ return (g_is_paused = 1);
++ case VOCTRL_RESUME:
++ return (g_is_paused = 0);
++ case VOCTRL_QUERY_FORMAT:
++ return query_format(*((uint32_t *)data));
++ case VOCTRL_GET_IMAGE:
++ return get_image(data);
++ case VOCTRL_DRAW_IMAGE:
++ return draw_image(data);
++ case VOCTRL_GUISUPPORT:
++ return VO_TRUE;
++ case VOCTRL_BORDER:
++ vo_x11_border();
++ resize();
++ return VO_TRUE;
++ case VOCTRL_FULLSCREEN:
++ vo_x11_fullscreen();
++ resize();
++ return VO_TRUE;
++ case VOCTRL_SET_EQUALIZER: {
++ vf_equalizer_t *eq = data;
++ if (g_image_format == IMGFMT_BGRA)
++ return VO_NOTIMPL;
++
++ return set_equalizer(eq->item, eq->value);
++ }
++ case VOCTRL_GET_EQUALIZER: {
++ vf_equalizer_t *eq = data;
++ return get_equalizer(eq->item, &eq->value);
++ }
++ case VOCTRL_ONTOP:
++ vo_x11_ontop();
++ return VO_TRUE;
++ case VOCTRL_UPDATE_SCREENINFO:
++ update_xinerama_info();
++ return VO_TRUE;
++ case VOCTRL_GET_PANSCAN:
++ return VO_TRUE;
++ case VOCTRL_SET_PANSCAN:
++ resize();
++ return VO_TRUE;
++ case VOCTRL_GET_HWACCEL_CONTEXT:
++ *((void **)data) = va_context;
++ return VO_TRUE;
++ case VOCTRL_DRAW_EOSD:
++ if (!data)
++ return VO_FALSE;
++ draw_eosd(data);
++ return VO_TRUE;
++ case VOCTRL_GET_EOSD_RES: {
++ struct mp_eosd_settings *r = data;
++ r->mt = r->mb = r->ml = r->mr = 0;
++ r->srcw = g_image_width;
++ r->srch = g_image_height;
++ r->w = g_image_width;
++ r->h = g_image_height;
++ return VO_TRUE;
++ }
++ }
++ return VO_NOTIMPL;
++}
+diff -Naur mplayer-1.0_rc4_p20120109/Makefile mplayer-1.0_rc4_p20120109-new/Makefile
+--- mplayer-1.0_rc4_p20120109/Makefile 2012-01-09 14:46:51.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/Makefile 2012-01-16 15:51:41.000000000 +0100
+@@ -601,6 +601,7 @@
+ SRCS_MPLAYER-$(TGA) += libvo/vo_tga.c
+ SRCS_MPLAYER-$(V4L2) += libvo/vo_v4l2.c
+ SRCS_MPLAYER-$(V4L2) += libao2/ao_v4l2.c
++SRCS_MPLAYER-$(VAAPI) += libvo/vo_vaapi.c
+ SRCS_MPLAYER-$(VDPAU) += libvo/vo_vdpau.c
+ SRCS_MPLAYER-$(VESA) += libvo/gtf.c libvo/vo_vesa.c libvo/vesa_lvo.c
+ SRCS_MPLAYER-$(VIDIX) += libvo/vo_cvidix.c \
+@@ -654,6 +655,7 @@
+ libao2/audio_out.c \
+ libvo/aspect.c \
+ libvo/geometry.c \
++ libvo/stats.c \
+ libvo/video_out.c \
+ libvo/vo_mpegpes.c \
+ libvo/vo_null.c \
diff --git a/media-sound/mplayer/files/extra/mplayer-vaapi_for_svn-35034.patch b/media-sound/mplayer/files/extra/mplayer-vaapi_for_svn-35034.patch
new file mode 100644
index 0000000..cf02d67
--- /dev/null
+++ b/media-sound/mplayer/files/extra/mplayer-vaapi_for_svn-35034.patch
@@ -0,0 +1,3883 @@
+diff -Naur mplayer-1.0_rc4_p20120109/cfg-common.h mplayer-1.0_rc4_p20120109-new/cfg-common.h
+--- mplayer-1.0_rc4_p20120109/cfg-common.h 2012-01-09 14:47:06.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/cfg-common.h 2012-01-16 15:51:41.000000000 +0100
+@@ -524,6 +524,7 @@
+ {"vfm", &video_fm_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
+ {"ac", &audio_codec_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
+ {"vc", &video_codec_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
++ {"va", &video_hwaccel_name, CONF_TYPE_STRING, 0, 0, 0, NULL},
+
+ // postprocessing:
+ #ifdef CONFIG_POSTPROC
+diff -Naur mplayer-1.0_rc4_p20120109/codec-cfg.c mplayer-1.0_rc4_p20120109-new/codec-cfg.c
+--- mplayer-1.0_rc4_p20120109/codec-cfg.c 2012-01-09 14:46:49.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/codec-cfg.c 2012-01-16 15:51:41.000000000 +0100
+@@ -252,6 +252,13 @@
+ {"VDPAU_VC1", IMGFMT_VDPAU_VC1},
+ {"VDPAU_MPEG4", IMGFMT_VDPAU_MPEG4},
+
++ {"VAAPI_MPEG2", IMGFMT_VAAPI_MPEG2},
++ {"VAAPI_MPEG4", IMGFMT_VAAPI_MPEG4},
++ {"VAAPI_H263", IMGFMT_VAAPI_H263},
++ {"VAAPI_H264", IMGFMT_VAAPI_H264},
++ {"VAAPI_WMV3", IMGFMT_VAAPI_WMV3},
++ {"VAAPI_VC1", IMGFMT_VAAPI_VC1},
++
+ {NULL, 0}
+ };
+
+diff -Naur mplayer-1.0_rc4_p20120109/configure mplayer-1.0_rc4_p20120109-new/configure
+--- mplayer-1.0_rc4_p20120109/configure 2012-01-09 14:46:57.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/configure 2012-01-16 15:51:41.000000000 +0100
+@@ -50,12 +50,13 @@
+ 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
++ if ! git clone 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
++ ffrevision=fc09bf57a60d4c4a6d339b204b3282337067c06d
++ cd ffmpeg && git checkout $ffrevision && cd ..
+ fi
+
+ # Prevent locale nonsense from breaking basic text processing utilities
+@@ -471,6 +473,9 @@
+ --disable-muxer=MUXER disable specified FFmpeg muxer
+ --enable-muxer=MUXER enable specified FFmpeg muxer
+
++Hardware acceleration:
++ --enable-vaapi enable VA-API acceleration [disable]
++
+ Video output:
+ --disable-vidix disable VIDIX [for x86 *nix]
+ --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
+@@ -500,6 +505,7 @@
+ --enable-dvb enable DVB video output [autodetect]
+ --enable-mga enable mga_vid video output [autodetect]
+ --enable-xmga enable mga_vid X11 video output [autodetect]
++ --enable-xrender enable Xrender video output [autodetect]
+ --enable-xv enable Xv video output [autodetect]
+ --enable-xvmc enable XvMC acceleration [disable]
+ --enable-vdpau enable VDPAU acceleration [autodetect]
+@@ -607,6 +613,7 @@
+ --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
+ --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
+
++ --with-vaapi-prefix=PATH prefix to VA-API include and lib directories
+ --with-freetype-config=PATH path to freetype-config
+ --with-glib-config=PATH path to glib*-config
+ --with-gtk-config=PATH path to gtk*-config
+@@ -674,8 +681,7 @@
+ libavbsfs_all=$(sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
+ libavbsfs=$libavbsfs_all
+ libavhwaccels_all=$(sed -n 's/^[^#]*HWACCEL.*(.*, *\(.*\)).*/\1_hwaccel/p' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
+-# Disable all hardware accelerators for now.
+-libavhwaccels=
++libavhwaccels=$(for h in $libavhwaccels_all; do case $h in (*_VAAPI_HWACCEL) echo $h;; esac; done)
+ 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]')
+@@ -687,11 +693,15 @@
+ libavfilters=$(echo $libavfilters_all | sed -e 's/ LIB[A-Z0-9_]*_FILTER//g' -e 's/ FREI0R[A-Z0-9_]*_FILTER//g' -e 's/ OCV_FILTER//g' -e 's/ MP_FILTER//g')
+ _mencoder=yes
+ _mplayer=yes
++_vaapi=auto
++_vaapi_glx=no
++_libgtop=auto
+ _x11=auto
+ _xshape=auto
+ _xss=auto
+ _dga1=auto
+ _dga2=auto
++_xrender=auto
+ _xv=auto
+ _xvmc=no #auto when complete
+ _vdpau=auto
+@@ -916,6 +927,9 @@
+ _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
+ ;;
+
++ --with-vaapi-prefix=*)
++ _vaapiprefix=$(echo $ac_option | cut -d '=' -f 2)
++ ;;
+ --with-sdl-config=*)
+ _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
+ ;;
+@@ -1031,10 +1045,14 @@
+ --disable-xshape) _xshape=no ;;
+ --enable-xss) _xss=yes ;;
+ --disable-xss) _xss=no ;;
++ --enable-xrender) _xrender=yes ;;
++ --disable-xrender) _xrender=no ;;
+ --enable-xv) _xv=yes ;;
+ --disable-xv) _xv=no ;;
+ --enable-xvmc) _xvmc=yes ;;
+ --disable-xvmc) _xvmc=no ;;
++ --enable-vaapi) _vaapi=yes ;;
++ --disable-vaapi) _vaapi=no ;;
+ --enable-vdpau) _vdpau=yes ;;
+ --disable-vdpau) _vdpau=no ;;
+ --enable-sdl) _sdl=yes ;;
+@@ -1129,6 +1147,8 @@
+ --disable-twolame) _twolame=no ;;
+ --enable-libcdio) _libcdio=yes ;;
+ --disable-libcdio) _libcdio=no ;;
++ --enable-libgtop) _libgtop=yes ;;
++ --disable-libgtop) _libgtop=no ;;
+ --enable-liblzo) _liblzo=yes ;;
+ --disable-liblzo) _liblzo=no ;;
+ --enable-libvorbis) _libvorbis=yes ;;
+@@ -3942,6 +3979,28 @@
+ echores "$gettimeofday"
+
+
++echocheck "clock_gettime()"
++cat > $TMPC << EOF
++#include <time.h>
++int main(void) {
++ struct timespec t;
++ clock_gettime(CLOCK_REALTIME, &t);
++ return 0;
++}
++EOF
++_clock_gettime=no
++cc_check -lrt && _clock_gettime=yes
++if test "$_clock_gettime" = yes ; then
++ def_clock_gettime='#define HAVE_CLOCK_GETTIME 1'
++ extra_ldflags="$extra_ldflags -lrt"
++ _need_clock_gettime=no
++else
++ def_clock_gettime='#undef HAVE_CLOCK_GETTIME'
++ _need_clock_gettime=yes
++fi
++echores "$_clock_gettime"
++
++
+ echocheck "glob()"
+ # glob_win disables a Windows-specific glob() replacement.
+ glob=yes
+@@ -4350,6 +4409,30 @@
+ fi
+
+
++echocheck "Xrender"
++if test "$_xrender" = auto ; then
++ cat > $TMPC <<EOF
++#include <X11/Xlib.h>
++#include <X11/extensions/Xrender.h>
++int main(void) {
++ (void) XRenderCreatePicture(0, 0, 0, 0, 0);
++ return 0; }
++EOF
++ _xrender=no
++ cc_check -lXrender && _xrender=yes
++fi
++
++if test "$_xrender" = yes ; then
++ def_xrender='#define CONFIG_XRENDER 1'
++ libs_mplayer="$libs_mplayer -lXrender"
++ vomodules="xrender $vomodules"
++else
++ def_xrender='#undef CONFIG_XRENDER'
++ novomodules="xrender $novomodules"
++fi
++echores "$_xrender"
++
++
+ echocheck "Xv"
+ if test "$_xv" = auto && test "$_x11" = yes ; then
+ _xv=no
+@@ -4830,6 +4912,31 @@
+ fi #if darwin
+
+
++echocheck "libgtop"
++if test "$_libgtop" = auto ; then
++ _libgtop=no
++ if $_pkg_config --exists 'libgtop-2.0' ; then
++
++cat > $TMPC << EOF
++#include <glibtop/cpu.h>
++#include <glibtop/proctime.h>
++int main(void) { return 0; }
++EOF
++cc_check $($_pkg_config --libs --cflags libgtop-2.0) && tmp_run && _libgtop=yes
++
++ fi
++fi
++echores "$_libgtop"
++
++if test "$_libgtop" = yes ; then
++ def_libgtop='#define CONFIG_LIBGTOP 1'
++ libs_mplayer="$libs_mplayer $($_pkg_config --libs libgtop-2.0)"
++ extra_cflags="$extra_cflags $($_pkg_config --cflags libgtop-2.0)"
++else
++ def_libgtop='#define CONFIG_LIBGTOP 0'
++fi
++
++
+ echocheck "PNG support"
+ if test "$_png" = auto ; then
+ _png=no
+@@ -5210,6 +5317,23 @@
+ fi
+ echores "$_gl"
+
++echocheck "OpenGL utilities (GLU)"
++_glu=no
++if test "$_gl" = yes; then
++ cat > $TMPC << EOF
++#include <GL/glu.h>
++int main(void) {
++ gluPerspective(0.0, 0.0, 0.0, 0.0);
++ return 0;
++}
++EOF
++ cc_check -lGLU && _glu=yes
++fi
++if test "$_glu" = yes; then
++ libs_mplayer="$libs_mplayer -lGLU"
++fi
++echores "$_glu"
++
+
+ echocheck "MatrixView"
+ if test "$matrixview" = auto ; then
+@@ -5685,6 +5799,57 @@
+ fi #if os2
+
+
++#########################
++# HARDWARE ACCELERATORS #
++#########################
++
++echocheck "VA-API"
++if test -n "$_vaapiprefix"; then
++ _vaapiinc="-I$_vaapiprefix/include"
++ _vaapilib="-L$_vaapiprefix/lib"
++fi
++if test "$_vaapi" = yes -o "$_vaapi" = auto; then
++ _vaapi=no
++ cat > $TMPC <<EOF
++#include <va/va_x11.h>
++int main(void) { (void) vaGetDisplay(0); return 0; }
++EOF
++ cc_check $_vaapiinc $_vaapilib -lva-x11 -lva && _vaapi=yes
++fi
++
++if test "$_vaapi" = yes ; then
++ def_vaapi='#define CONFIG_VAAPI 1'
++ extra_cflags="$extra_cflags $_vaapiinc"
++ libs_mencoder="$libs_mencoder $_vaapilib -lva"
++ libs_mplayer="$libs_mplayer $_vaapilib -lva-x11 -lva"
++ vomodules="vaapi $vomodules"
++else
++ def_vaapi='#define CONFIG_VAAPI 0'
++ novomodules="vaapi $novomodules"
++ libavhwaccels=`echo $libavhwaccels | sed -e "s/\(MPEG[124]\|H26[34]\|WMV3\|VC1\)_VAAPI_HWACCEL//g"`
++fi
++echores "$_vaapi"
++
++echocheck "VA-API (with GLX support)"
++if test "$_vaapi" = yes; then
++ _vaapi_glx=no
++ if test "$_gl" = "yes" -a "$_glu" = yes; then
++ cat > $TMPC <<EOF
++#include <va/va_glx.h>
++int main(void) { (void) vaGetDisplayGLX(0); return 0; }
++EOF
++ cc_check $_vaapiinc $_vaapilib -lva-glx -lva && _vaapi_glx=yes
++ fi
++fi
++if test "$_vaapi_glx" = yes; then
++ def_vaapi_glx='#define CONFIG_VAAPI_GLX 1'
++ libs_mplayer="$libs_mplayer -lva-glx -lva"
++else
++ def_vaapi_glx='#define CONFIG_VAAPI_GLX 0'
++fi
++echores "$_vaapi_glx"
++
++
+ # set default CD/DVD devices
+ if win32 || os2 ; then
+ default_cdrom_device="D:"
+@@ -8169,6 +8348,7 @@
+ TWOLAME=$_twolame
+ UNRAR_EXEC = $_unrar_exec
+ V4L2 = $_v4l2
++VAAPI = $_vaapi
+ VCD = $_vcd
+ VDPAU = $_vdpau
+ VESA = $_vesa
+@@ -8277,8 +8453,10 @@
+ CONFIG_MUXERS = yes
+ CONFIG_NETWORK = $networking
+ CONFIG_RTPDEC = $networking
++CONFIG_VAAPI = $_vaapi
+ CONFIG_VF_LAVFI = $_vf_lavfi
+ CONFIG_VDPAU = $_vdpau
++CONFIG_XRENDER = $_xrender
+ CONFIG_XVMC = $_xvmc
+ CONFIG_ZLIB = $_zlib
+
+@@ -8394,6 +8573,7 @@
+
+
+ /* system functions */
++$def_clock_gettime
+ $def_gethostbyname2
+ $def_gettimeofday
+ $def_glob
+@@ -8423,6 +8603,7 @@
+ $def_extern_prefix
+ $def_iconv
+ $def_kstat
++$def_libgtop
+ $def_macosx_bundle
+ $def_macosx_finder
+ $def_maemo
+@@ -8652,6 +8833,8 @@
+ $def_tdfxvid
+ $def_tga
+ $def_v4l2
++$def_vaapi
++$def_vaapi_glx
+ $def_vdpau
+ $def_vesa
+ $def_vidix
+@@ -8677,6 +8860,7 @@
+ $def_xinerama
+ $def_xmga
+ $def_xss
++$def_xrender
+ $def_xv
+ $def_xvmc
+ $def_xvr100
+diff -Naur mplayer-1.0_rc4_p20120109/etc/codecs.conf mplayer-1.0_rc4_p20120109-new/etc/codecs.conf
+--- mplayer-1.0_rc4_p20120109/etc/codecs.conf 2012-01-09 14:47:11.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/etc/codecs.conf 2012-01-16 15:51:41.000000000 +0100
+@@ -360,6 +371,7 @@
+ fourcc slif ; SoftLab MPEG-2 I-frames Codec
+ driver ffmpeg
+ dll "mpeg2video"
++ out VAAPI_MPEG2
+ out YV12,I420,IYUV
+ out 422P,444P
+ out IDCT_MPEG2
+@@ -1163,6 +1165,7 @@
+ fourcc WMV3,wmv3
+ driver ffmpeg
+ dll wmv3
++ out VAAPI_WMV3
+ out YV12,I420,IYUV
+
+ videocodec ffwvp2
+@@ -1204,6 +1207,7 @@
+ fourcc vc-1,VC-1
+ driver ffmpeg
+ dll vc1
++ out VAAPI_VC1
+ out YV12,I420,IYUV
+
+ videocodec ffvc1vdpau
+@@ -1261,6 +1265,7 @@
+ out 422P,422P9,422P10,444P12,444P14
+ out 444P,444P9,444P10,444P12,444P14
+ out GBR24P,GBR12P,GBR14P
++ out VAAPI_H264
+
+ videocodec ffh264vdpau
+ info "FFmpeg H.264 (VDPAU)"
+@@ -1361,6 +1347,7 @@
+ fourcc QMP4,HV60,PLV1
+ driver ffmpeg
+ dll mpeg4 ;opendivx
++ out VAAPI_MPEG4
+ out YV12,I420,IYUV
+
+ videocodec ffodivxvdpau
+@@ -2022,6 +2029,7 @@
+ fourcc VX1K ; Agora Labs VX1000S H263
+ driver ffmpeg
+ dll h263
++ out VAAPI_H263
+ out YV12,I420,IYUV
+
+ videocodec ffzygo
+diff -Naur mplayer-1.0_rc4_p20120109/fmt-conversion.c mplayer-1.0_rc4_p20120109-new/fmt-conversion.c
+--- mplayer-1.0_rc4_p20120109/fmt-conversion.c 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/fmt-conversion.c 2012-01-16 15:51:41.000000000 +0100
+@@ -18,6 +18,7 @@
+
+ #include "mp_msg.h"
+ #include "libavutil/avutil.h"
++#include "libavcodec/avcodec.h"
+ #include "libmpcodecs/img_format.h"
+ #include "libavutil/pixfmt.h"
+ #include "libavutil/samplefmt.h"
+@@ -27,6 +28,7 @@
+ static const struct {
+ int fmt;
+ enum PixelFormat pix_fmt;
++ enum CodecID codec_id;
+ } conversion_map[] = {
+ {IMGFMT_ARGB, PIX_FMT_ARGB},
+ {IMGFMT_BGRA, PIX_FMT_BGRA},
+@@ -143,6 +145,17 @@
+ {IMGFMT_VDPAU_WMV3, PIX_FMT_VDPAU_WMV3},
+ {IMGFMT_VDPAU_VC1, PIX_FMT_VDPAU_VC1},
+ {IMGFMT_VDPAU_MPEG4, PIX_FMT_VDPAU_MPEG4},
++
++ /* VA-API formats */
++ {IMGFMT_VAAPI_MPEG2, PIX_FMT_VAAPI_VLD, CODEC_ID_MPEG2VIDEO},
++ {IMGFMT_VAAPI_MPEG2_IDCT,PIX_FMT_VAAPI_IDCT, CODEC_ID_MPEG2VIDEO},
++ {IMGFMT_VAAPI_MPEG2_MOCO,PIX_FMT_VAAPI_MOCO, CODEC_ID_MPEG2VIDEO},
++ {IMGFMT_VAAPI_MPEG4, PIX_FMT_VAAPI_VLD, CODEC_ID_MPEG4},
++ {IMGFMT_VAAPI_H263, PIX_FMT_VAAPI_VLD, CODEC_ID_H263},
++ {IMGFMT_VAAPI_H264, PIX_FMT_VAAPI_VLD, CODEC_ID_H264},
++ {IMGFMT_VAAPI_WMV3, PIX_FMT_VAAPI_VLD, CODEC_ID_WMV3},
++ {IMGFMT_VAAPI_VC1, PIX_FMT_VAAPI_VLD, CODEC_ID_VC1},
++
+ {0, PIX_FMT_NONE}
+ };
+
+@@ -159,12 +172,14 @@
+ return pix_fmt;
+ }
+
+-int pixfmt2imgfmt(enum PixelFormat pix_fmt)
++int pixfmt2imgfmt(enum PixelFormat pix_fmt, int codec_id)
+ {
+ int i;
+ int fmt;
+ for (i = 0; conversion_map[i].pix_fmt != PIX_FMT_NONE; i++)
+- if (conversion_map[i].pix_fmt == pix_fmt)
++ if (conversion_map[i].pix_fmt == pix_fmt &&
++ (conversion_map[i].codec_id == 0 ||
++ conversion_map[i].codec_id == codec_id))
+ break;
+ fmt = conversion_map[i].fmt;
+ if (!fmt)
+diff -Naur mplayer-1.0_rc4_p20120109/fmt-conversion.h mplayer-1.0_rc4_p20120109-new/fmt-conversion.h
+--- mplayer-1.0_rc4_p20120109/fmt-conversion.h 2012-01-09 14:46:49.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/fmt-conversion.h 2012-01-16 15:51:41.000000000 +0100
+@@ -24,7 +24,7 @@
+ #include "libavutil/samplefmt.h"
+
+ enum PixelFormat imgfmt2pixfmt(int fmt);
+-int pixfmt2imgfmt(enum PixelFormat pix_fmt);
++int pixfmt2imgfmt(enum PixelFormat pix_fmt, int codec_id);
+ enum AVSampleFormat affmt2samplefmt(int fmt);
+ int samplefmt2affmt(enum AVSampleFormat sample_fmt);
+
+diff -Naur mplayer-1.0_rc4_p20120109/help/help_mp-en.h mplayer-1.0_rc4_p20120109-new/help/help_mp-en.h
+--- mplayer-1.0_rc4_p20120109/help/help_mp-en.h 2012-01-09 14:47:08.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/help/help_mp-en.h 2012-01-16 15:51:41.000000000 +0100
+@@ -754,6 +754,7 @@
+ #define MSGTR_PREFERENCES_IDX "Rebuild index table, if needed"
+ #define MSGTR_PREFERENCES_VideoCodecFamily "Video codec family:"
+ #define MSGTR_PREFERENCES_AudioCodecFamily "Audio codec family:"
++#define MSGTR_PREFERENCES_VideoHardwareAcceleration "Video hardware acceleration:"
+ #define MSGTR_PREFERENCES_FRAME_OSD_Level "OSD level"
+ #define MSGTR_PREFERENCES_FRAME_Subtitle "Subtitle"
+ #define MSGTR_PREFERENCES_FRAME_Font "Font"
+@@ -1659,6 +1660,7 @@
+ #define MSGTR_MPCODECS_UnexpectedInitVoError "[VD_FFMPEG] Unexpected init_vo error.\n"
+ #define MSGTR_MPCODECS_UnrecoverableErrorRenderBuffersNotTaken "[VD_FFMPEG] Unrecoverable error, render buffers not taken.\n"
+ #define MSGTR_MPCODECS_OnlyBuffersAllocatedByVoXvmcAllowed "[VD_FFMPEG] Only buffers allocated by vo_xvmc allowed.\n"
++#define MSGTR_MPCODECS_VAAPIAcceleratedCodec "[VD_FFMPEG] VA API accelerated codec.\n"
+
+ // libmpcodecs/ve_lavc.c
+ #define MSGTR_MPCODECS_HighQualityEncodingSelected "[VE_LAVC] High quality encoding selected (non-realtime)!\n"
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/dec_video.c mplayer-1.0_rc4_p20120109-new/libmpcodecs/dec_video.c
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/dec_video.c 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/dec_video.c 2012-01-16 15:51:41.000000000 +0100
+@@ -53,9 +53,47 @@
+ int field_dominance = -1;
+
+ int divx_quality = 0;
++char *video_hwaccel_name=NULL;
+
+ const vd_functions_t *mpvdec = NULL;
+
++int get_video_hwaccel(void)
++{
++ static int video_hwaccel = -1;
++ if (video_hwaccel < 0) {
++ video_hwaccel = HWACCEL_NONE;
++ if (video_hwaccel_name) {
++ if (!strcmp(video_hwaccel_name,"xvmc"))
++ video_hwaccel = HWACCEL_XVMC;
++ else if (!strcmp(video_hwaccel_name,"vaapi"))
++ video_hwaccel = HWACCEL_VAAPI;
++ else if (!strcmp(video_hwaccel_name,"vdpau"))
++ video_hwaccel = HWACCEL_VDPAU;
++ }
++ }
++ return video_hwaccel;
++}
++
++const char *get_video_hwaccel_name(int hwaccel)
++{
++ switch (hwaccel) {
++ case HWACCEL_XVMC: return "XvMC";
++ case HWACCEL_VAAPI: return "VA API";
++ case HWACCEL_VDPAU: return "VDPAU";
++ }
++ return NULL;
++}
++
++const char *get_video_hwaccel_short_name(int hwaccel)
++{
++ switch (hwaccel) {
++ case HWACCEL_XVMC: return "xvmc";
++ case HWACCEL_VAAPI: return "vaapi";
++ case HWACCEL_VDPAU: return "vdpau";
++ }
++ return NULL;
++}
++
+ int get_video_quality_max(sh_video_t *sh_video)
+ {
+ vf_instance_t *vf = sh_video->vfilter;
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/dec_video.h mplayer-1.0_rc4_p20120109-new/libmpcodecs/dec_video.h
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/dec_video.h 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/dec_video.h 2012-01-16 15:51:41.000000000 +0100
+@@ -21,6 +21,14 @@
+
+ #include "libmpdemux/stheader.h"
+
++enum {
++ HWACCEL_NONE = 0,
++ HWACCEL_XVMC,
++ HWACCEL_VAAPI,
++ HWACCEL_VDPAU,
++ HWACCEL_COUNT
++};
++
+ extern int field_dominance;
+
+ // dec_video.c:
+@@ -41,6 +49,11 @@
+ void resync_video_stream(sh_video_t *sh_video);
+ int get_current_video_decoder_lag(sh_video_t *sh_video);
+
++int get_video_hwaccel(void);
++const char *get_video_hwaccel_name(int hwaccel);
++const char *get_video_hwaccel_short_name(int hwaccel);
++
+ extern int divx_quality;
++extern char *video_hwaccel_name;
+
+ #endif /* MPLAYER_DEC_VIDEO_H */
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/img_format.c mplayer-1.0_rc4_p20120109-new/libmpcodecs/img_format.c
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/img_format.c 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/img_format.c 2012-01-16 15:51:41.000000000 +0100
+@@ -137,6 +137,14 @@
+ case IMGFMT_VDPAU_MPEG4: return "MPEG-4 Part 2 VDPAU acceleration";
+ case IMGFMT_VDPAU_WMV3: return "WMV3 VDPAU acceleration";
+ case IMGFMT_VDPAU_VC1: return "VC1 VDPAU acceleration";
++ case IMGFMT_VAAPI_MPEG2: return "MPEG-2 VA-API Acceleration";
++ case IMGFMT_VAAPI_MPEG2_IDCT: return "MPEG-2 VA-API Acceleration (Motion Compensation and IDCT)";
++ case IMGFMT_VAAPI_MPEG2_MOCO: return "MPEG-2 VA-API Acceleration (Motion Compensation)";
++ case IMGFMT_VAAPI_MPEG4: return "MPEG-4 VA-API Acceleration";
++ case IMGFMT_VAAPI_H263: return "H.263 VA-API Acceleration";
++ case IMGFMT_VAAPI_H264: return "H.264 VA-API Acceleration";
++ case IMGFMT_VAAPI_WMV3: return "WMV3 VA-API Acceleration";
++ case IMGFMT_VAAPI_VC1: return "VC-1 VA-API Acceleration";
+ }
+ snprintf(unknown_format,20,"Unknown 0x%04x",format);
+ return unknown_format;
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/img_format.h mplayer-1.0_rc4_p20120109-new/libmpcodecs/img_format.h
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/img_format.h 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/img_format.h 2012-01-16 15:51:41.000000000 +0100
+@@ -255,6 +255,26 @@
+ #define IMGFMT_XVMC_MOCO_MPEG2 (IMGFMT_XVMC|0x02)
+ #define IMGFMT_XVMC_IDCT_MPEG2 (IMGFMT_XVMC|0x82)
+
++/* VA-API Formats */
++
++#define IMGFMT_VAAPI 0x56410000 /* 'VA'00 */
++#define IMGFMT_VAAPI_MASK 0xFFFF0000
++#define IMGFMT_IS_VAAPI(fmt) (((fmt) & IMGFMT_VAAPI_MASK) == IMGFMT_VAAPI)
++#define IMGFMT_VAAPI_CODEC_MASK 0x000000F0
++#define IMGFMT_VAAPI_CODEC(fmt) ((fmt) & IMGFMT_VAAPI_CODEC_MASK)
++#define IMGFMT_VAAPI_CODEC_MPEG2 (0x10)
++#define IMGFMT_VAAPI_CODEC_MPEG4 (0x20)
++#define IMGFMT_VAAPI_CODEC_H264 (0x30)
++#define IMGFMT_VAAPI_CODEC_VC1 (0x40)
++#define IMGFMT_VAAPI_MPEG2 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG2)
++#define IMGFMT_VAAPI_MPEG2_IDCT (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG2|1)
++#define IMGFMT_VAAPI_MPEG2_MOCO (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG2|2)
++#define IMGFMT_VAAPI_MPEG4 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG4)
++#define IMGFMT_VAAPI_H263 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_MPEG4|1)
++#define IMGFMT_VAAPI_H264 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_H264)
++#define IMGFMT_VAAPI_VC1 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_VC1)
++#define IMGFMT_VAAPI_WMV3 (IMGFMT_VAAPI|IMGFMT_VAAPI_CODEC_VC1|1)
++
+ // VDPAU specific format.
+ #define IMGFMT_VDPAU 0x1DC80000
+ #define IMGFMT_VDPAU_MASK 0xFFFF0000
+@@ -266,7 +286,9 @@
+ #define IMGFMT_VDPAU_VC1 (IMGFMT_VDPAU|0x05)
+ #define IMGFMT_VDPAU_MPEG4 (IMGFMT_VDPAU|0x06)
+
+-#define IMGFMT_IS_HWACCEL(fmt) (IMGFMT_IS_VDPAU(fmt) || IMGFMT_IS_XVMC(fmt))
++#define IMGFMT_IS_HWACCEL(fmt) (IMGFMT_IS_VAAPI(fmt) || \
++ IMGFMT_IS_VDPAU(fmt) || \
++ IMGFMT_IS_XVMC(fmt))
+
+ typedef struct {
+ void* data;
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/vd.c mplayer-1.0_rc4_p20120109-new/libmpcodecs/vd.c
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/vd.c 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/vd.c 2012-01-16 15:51:41.000000000 +0100
+@@ -403,3 +403,12 @@
+ if (vf->draw_slice)
+ vf->draw_slice(vf, src, stride, w, h, x, y);
+ }
++
++void *mpcodecs_get_hwaccel_context(sh_video_t *sh)
++{
++ void *ctx = NULL;
++ struct vf_instance *vf = sh->vfilter;
++ if (vf->control(vf, VFCTRL_GET_HWACCEL_CONTEXT, &ctx) == CONTROL_TRUE)
++ return ctx;
++ return NULL;
++}
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/vd_ffmpeg.c mplayer-1.0_rc4_p20120109-new/libmpcodecs/vd_ffmpeg.c
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/vd_ffmpeg.c 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/vd_ffmpeg.c 2012-01-16 15:51:41.000000000 +0100
+@@ -34,6 +34,7 @@
+ #include "fmt-conversion.h"
+
+ #include "vd_internal.h"
++#include "dec_video.h"
+
+ static const vd_info_t info = {
+ "FFmpeg's libavcodec codec family",
+@@ -192,7 +193,7 @@
+ int imgfmt;
+ if (fmt == PIX_FMT_NONE)
+ return;
+- imgfmt = pixfmt2imgfmt(fmt);
++ imgfmt = pixfmt2imgfmt(fmt, avctx->codec_id);
+ if (IMGFMT_IS_HWACCEL(imgfmt)) {
+ sh_video_t *sh = avctx->opaque;
+ vd_ffmpeg_ctx *ctx = sh->context;
+@@ -453,7 +454,7 @@
+ const AVFrame *src, int offset[4],
+ int y, int type, int height){
+ sh_video_t *sh = s->opaque;
+- uint8_t *source[MP_MAX_PLANES]= {src->data[0] + offset[0], src->data[1] + offset[1], src->data[2] + offset[2]};
++ uint8_t *source[MP_MAX_PLANES]= {src->data[0] + offset[0], src->data[1] + offset[1], src->data[2] + offset[2], src->data[3] + offset[3]};
+ int strides[MP_MAX_PLANES] = {src->linesize[0], src->linesize[1], src->linesize[2]};
+ if (height < 0)
+ {
+@@ -515,9 +516,10 @@
+ sh->disp_w = width;
+ sh->disp_h = height;
+ ctx->pix_fmt = pix_fmt;
+- ctx->best_csp = pixfmt2imgfmt(pix_fmt);
++ ctx->best_csp = pixfmt2imgfmt(pix_fmt, avctx->codec_id);
+ if (!mpcodecs_config_vo(sh, sh->disp_w, sh->disp_h, ctx->best_csp))
+ return -1;
++ avctx->hwaccel_context = mpcodecs_get_hwaccel_context(sh);
+ ctx->vo_initialized = 1;
+ }
+ return 0;
+@@ -952,22 +954,60 @@
+ return mpi;
+ }
+
++static inline int is_hwaccel_format(int imgfmt)
++{
++ switch (get_video_hwaccel()) {
++ case HWACCEL_VAAPI: return IMGFMT_IS_VAAPI(imgfmt) != 0;
++ case HWACCEL_VDPAU: return IMGFMT_IS_VDPAU(imgfmt) != 0;
++ case HWACCEL_XVMC: return IMGFMT_IS_XVMC(imgfmt) != 0;
++ }
++ return 0;
++}
++
++static int query_format(sh_video_t *sh, int fmt)
++{
++ vd_ffmpeg_ctx * const ctx = sh->context;
++ AVCodecContext * const avctx = ctx->avctx;
++ int r, width, height;
++ /* XXX: some codecs have not initialized width and height yet at
++ this point, so we are faking the dimensions so that init_vo()
++ doesn't fail because of 0x0 size */
++ if ((width = avctx->width) == 0)
++ avctx->width = 64;
++ if ((height = avctx->height) == 0)
++ avctx->height = 64;
++ r = init_vo(sh, fmt);
++ avctx->width = width;
++ avctx->height = height;
++ return r;
++}
++
+ static enum PixelFormat get_format(struct AVCodecContext *avctx,
+- const enum PixelFormat *fmt){
+- enum PixelFormat selected_format;
++ const enum PixelFormat *fmt){
++ enum PixelFormat selected_format = PIX_FMT_NONE;
+ 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;
++ 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);
++ if ((try_hwaccel ^ is_hwaccel_format(imgfmt)) != 0)
++ continue;
++ mp_msg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_MPCODECS_TryingPixfmt, i);
++ if (query_format(sh, fmt[i]) >= 0) {
++ if (try_hwaccel) {
++ /* don't allow format conversion for HW acceleration */
++ if (sh->codec->outfmt[sh->outfmtidx] != imgfmt)
++ continue;
++ }
++ selected_format = fmt[i];
++ break;
++ }
+ }
++ if (selected_format != PIX_FMT_NONE)
++ 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);
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/vd.h mplayer-1.0_rc4_p20120109-new/libmpcodecs/vd.h
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/vd.h 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/vd.h 2012-01-16 15:51:41.000000000 +0100
+@@ -64,6 +64,7 @@
+ int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outfmt);
+ mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag, int w, int h);
+ void mpcodecs_draw_slice(sh_video_t *sh, unsigned char** src, int* stride, int w,int h, int x, int y);
++void *mpcodecs_get_hwaccel_context(sh_video_t *sh);
+
+ #define VDFLAGS_DROPFRAME 3
+
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/vf.h mplayer-1.0_rc4_p20120109-new/libmpcodecs/vf.h
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/vf.h 2012-01-09 14:46:48.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/vf.h 2012-01-16 15:51:41.000000000 +0100
+@@ -111,6 +111,7 @@
+ #define VFCTRL_GET_PTS 17 /* Return last pts value that reached vf_vo*/
+ #define VFCTRL_SET_DEINTERLACE 18 /* Set deinterlacing status */
+ #define VFCTRL_GET_DEINTERLACE 19 /* Get deinterlacing status */
++#define VFCTRL_GET_HWACCEL_CONTEXT 20 /* Get HW accelerator context */
+
+ #include "vfcap.h"
+
+diff -Naur mplayer-1.0_rc4_p20120109/libmpcodecs/vf_vo.c mplayer-1.0_rc4_p20120109-new/libmpcodecs/vf_vo.c
+--- mplayer-1.0_rc4_p20120109/libmpcodecs/vf_vo.c 2012-01-09 14:46:46.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libmpcodecs/vf_vo.c 2012-01-16 15:51:41.000000000 +0100
+@@ -136,6 +136,12 @@
+ *(double *)data = vf->priv->pts;
+ return CONTROL_TRUE;
+ }
++ case VFCTRL_GET_HWACCEL_CONTEXT:
++ {
++ if(!video_out) return CONTROL_FALSE; // vo not configured?
++ return(video_out->control(VOCTRL_GET_HWACCEL_CONTEXT, data)
++ == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE;
++ }
+ }
+ // return video_out->control(request,data);
+ return CONTROL_UNKNOWN;
+diff -Naur mplayer-1.0_rc4_p20120109/libvo/gl_common.c mplayer-1.0_rc4_p20120109-new/libvo/gl_common.c
+--- mplayer-1.0_rc4_p20120109/libvo/gl_common.c 2012-01-09 14:46:56.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libvo/gl_common.c 2012-01-16 15:51:41.000000000 +0100
+@@ -140,7 +140,6 @@
+ void (GLAPIENTRY *mpglFreeMemoryMESA)(void *, int, void *);
+ /** \} */ // end of glextfunctions group
+
+-
+ void (GLAPIENTRY *mpglVertexPointer)(GLint, GLenum, GLsizei, const GLvoid *);
+ void (GLAPIENTRY *mpglTexCoordPointer)(GLint, GLenum, GLsizei, const GLvoid *);
+ void (GLAPIENTRY *mpglClientActiveTexture)(GLenum);
+@@ -148,6 +147,12 @@
+ void (GLAPIENTRY *mpglDisableClientState)(GLenum);
+ void (GLAPIENTRY *mpglDrawArrays)(GLenum, GLint, GLsizei);
+
++
++void (GLAPIENTRY *mpglXBindTexImage)(Display *, GLXDrawable, int, const int *);
++void (GLAPIENTRY *mpglXReleaseTexImage)(Display *, GLXDrawable, int);
++GLXPixmap (GLAPIENTRY *mpglXCreatePixmap)(Display *, GLXFBConfig, Pixmap, const int *);
++void (GLAPIENTRY *mpglXDestroyPixmap)(Display *, GLXPixmap);
++
+ //! \defgroup glgeneral OpenGL general helper functions
+
+ //! \defgroup glcontext OpenGL context management helper functions
+@@ -490,6 +495,12 @@
+ {&mpglEnableClientState, NULL, {"glEnableClientState", NULL}},
+ {&mpglDisableClientState, NULL, {"glDisableClientState", NULL}},
+ {&mpglDrawArrays, NULL, {"glDrawArrays", NULL}},
++
++ {&mpglXBindTexImage, "GLX_EXT_texture_from_pixmap", {"glXBindTexImageEXT", NULL}},
++ {&mpglXReleaseTexImage, "GLX_EXT_texture_from_pixmap", {"glXReleaseTexImageEXT", NULL}},
++ {&mpglXCreatePixmap, "GLX_EXT_texture_from_pixmap", {"glXCreatePixmap", NULL}},
++ {&mpglXDestroyPixmap, "GLX_EXT_texture_from_pixmap", {"glXDestroyPixmap", NULL}},
++
+ {NULL}
+ };
+
+diff -Naur mplayer-1.0_rc4_p20120109/libvo/gl_common.h mplayer-1.0_rc4_p20120109-new/libvo/gl_common.h
+--- mplayer-1.0_rc4_p20120109/libvo/gl_common.h 2012-01-09 14:46:56.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libvo/gl_common.h 2012-01-16 15:51:41.000000000 +0100
+@@ -533,4 +533,9 @@
+ extern void* (GLAPIENTRY *mpglAllocateMemoryMESA)(void *, int, size_t, float, float, float);
+ extern void (GLAPIENTRY *mpglFreeMemoryMESA)(void *, int, void *);
+
++extern void (GLAPIENTRY *mpglXBindTexImage)(Display *, GLXDrawable, int, const int *);
++extern void (GLAPIENTRY *mpglXReleaseTexImage)(Display *, GLXDrawable, int);
++extern GLXPixmap (GLAPIENTRY *mpglXCreatePixmap)(Display *, GLXFBConfig, Pixmap, const int *);
++extern void (GLAPIENTRY *mpglXDestroyPixmap)(Display *, GLXPixmap);
++
+ #endif /* MPLAYER_GL_COMMON_H */
+diff -Naur mplayer-1.0_rc4_p20120109/libvo/stats.c mplayer-1.0_rc4_p20120109-new/libvo/stats.c
+--- mplayer-1.0_rc4_p20120109/libvo/stats.c 1970-01-01 01:00:00.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libvo/stats.c 2012-01-16 15:51:41.000000000 +0100
+@@ -0,0 +1,217 @@
++#include "config.h"
++#include "stats.h"
++#include <time.h>
++#include <stdio.h>
++#include <string.h>
++#include <unistd.h>
++#include <locale.h>
++#include <inttypes.h>
++
++#if CONFIG_LIBGTOP
++#include <glibtop/cpu.h>
++#include <glibtop/proctime.h>
++#include <glibtop/procstate.h>
++#endif
++
++// Process statistics
++struct proc_stats {
++ uint64_t utime;
++ uint64_t stime;
++ uint64_t cutime;
++ uint64_t cstime;
++ uint64_t frequency;
++ uint64_t cpu_time;
++ uint64_t start_time;
++ uint64_t current_time;
++};
++
++// Get current process stats
++static int get_proc_stats(struct proc_stats *pstats);
++
++void stats_init(void)
++{
++#if CONFIG_LIBGTOP
++ glibtop_init();
++#endif
++}
++
++void stats_exit(void)
++{
++#if CONFIG_LIBGTOP
++ glibtop_close();
++#endif
++}
++
++// Get CPU frequency
++unsigned int get_cpu_frequency(void)
++{
++ unsigned int freq = 0;
++#if defined __linux__
++ {
++ FILE *proc_file = fopen("/proc/cpuinfo", "r");
++ if (proc_file) {
++ char line[256];
++ char *old_locale = setlocale(LC_NUMERIC, NULL);
++ setlocale(LC_NUMERIC, "C");
++ while(fgets(line, sizeof(line), proc_file)) {
++ float f;
++ int len = strlen(line);
++ if (len == 0)
++ continue;
++ line[len - 1] = 0;
++ if (sscanf(line, "cpu MHz : %f", &f) == 1)
++ freq = (unsigned int)f;
++ }
++ setlocale(LC_NUMERIC, old_locale);
++ fclose(proc_file);
++ }
++ }
++#endif
++ return freq;
++}
++
++// Get CPU usage in percent
++static float get_cpu_usage_1(void)
++{
++ static struct proc_stats prev_stats;
++ struct proc_stats curr_stats;
++ uint64_t prev_proc_time = 0, curr_proc_time = 0;
++ float pcpu = 0.0f;
++
++ if (get_proc_stats(&curr_stats) == 0) {
++ prev_proc_time += prev_stats.utime;
++ prev_proc_time += prev_stats.stime;
++ prev_proc_time += prev_stats.cutime;
++ prev_proc_time += prev_stats.cstime;
++ curr_proc_time += curr_stats.utime;
++ curr_proc_time += curr_stats.stime;
++ curr_proc_time += curr_stats.cutime;
++ curr_proc_time += curr_stats.cstime;
++ if (prev_stats.start_time > 0)
++ pcpu = 100.0 * ((float)(curr_proc_time - prev_proc_time) /
++ (float)(curr_stats.cpu_time - prev_stats.cpu_time));
++ prev_stats = curr_stats;
++ }
++ return pcpu;
++}
++
++float get_cpu_usage(enum CpuUsageType type)
++{
++ static float pcpu_total = 0.0;
++ static unsigned int n_samples;
++ float pcpu;
++
++ pcpu = get_cpu_usage_1();
++ pcpu_total += pcpu / 100.0;
++ ++n_samples;
++
++ if (type == CPU_USAGE_AVERAGE)
++ pcpu = 100.0 * (pcpu_total / n_samples);
++ return pcpu;
++}
++
++// For ELF executable, notes are pushed before environment and args
++static int find_elf_note(unsigned long match, unsigned long *pval)
++{
++ unsigned long *ep = (unsigned long *)__environ;
++ while (*ep++);
++ for (; *ep != 0; ep += 2) {
++ if (ep[0] == match) {
++ *pval = ep[1];
++ return 0;
++ }
++ }
++ return -1;
++}
++
++#ifndef AT_CLKTCK
++#define AT_CLKTCK 17
++#endif
++
++// Get current process stats
++int get_proc_stats(struct proc_stats *pstats)
++{
++ int error = -1;
++ char line[256], *str, *end;
++ char vc;
++ int vi;
++ unsigned long vul;
++ unsigned long long vull;
++ float vf;
++#if defined __linux__
++ {
++ FILE *proc_file = fopen("/proc/self/stat", "r");
++ if (proc_file) {
++ if (fgets(line, sizeof(line), proc_file)) {
++ unsigned long utime, stime, cutime, cstime, start_time;
++ str = strrchr(line, ')');
++ if (str && sscanf(str + 2,
++ "%c "
++ "%d %d %d %d %d "
++ "%lu %lu %lu %lu %lu %lu %lu "
++ "%ld %ld %ld %ld %ld %ld "
++ "%lu %lu ",
++ &vc,
++ &vi, &vi, &vi, &vi, &vi,
++ &vul, &vul, &vul, &vul, &vul, &utime, &stime,
++ &cutime, &cstime, &vul, &vul, &vul, &vul,
++ &start_time, &vul) == 21) {
++ pstats->utime = utime;
++ pstats->stime = stime;
++ pstats->cutime = cutime;
++ pstats->cstime = cstime;
++ pstats->start_time = start_time;
++ error = 0;
++ }
++ }
++ fclose(proc_file);
++ }
++ if (error)
++ return error;
++ error = -1;
++
++ if (find_elf_note(AT_CLKTCK, &vul) == 0) {
++ pstats->frequency = vul;
++ error = 0;
++ }
++ if (error)
++ return error;
++ error = -1;
++
++ proc_file = fopen("/proc/uptime", "r");
++ if (proc_file) {
++ if (fgets(line, sizeof(line), proc_file)) {
++ char *old_locale = setlocale(LC_NUMERIC, NULL);
++ setlocale(LC_NUMERIC, "C");
++ if (sscanf(line, "%f", &vf) == 1) {
++ pstats->cpu_time = (uint64_t)(vf * (float)pstats->frequency);
++ error = 0;
++ }
++ setlocale(LC_NUMERIC, old_locale);
++ }
++ fclose(proc_file);
++ }
++ }
++#elif CONFIG_LIBGTOP
++ {
++ glibtop_cpu cpu;
++ glibtop_proc_time proc_time;
++ glibtop_proc_state proc_state;
++
++ glibtop_get_cpu(&cpu);
++ glibtop_get_proc_state(&proc_state, getpid());
++ pstats->cpu_time = cpu.xcpu_total[proc_state.processor];
++
++ glibtop_get_proc_time(&proc_time, getpid());
++ pstats->utime = proc_time.utime;
++ pstats->stime = proc_time.stime;
++ pstats->cutime = proc_time.cutime;
++ pstats->cstime = proc_time.cstime;
++ pstats->start_time = proc_time.start_time;
++ pstats->frequency = proc_time.frequency;
++
++ error = 0;
++ }
++#endif
++ return error;
++}
+diff -Naur mplayer-1.0_rc4_p20120109/libvo/stats.h mplayer-1.0_rc4_p20120109-new/libvo/stats.h
+--- mplayer-1.0_rc4_p20120109/libvo/stats.h 1970-01-01 01:00:00.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libvo/stats.h 2012-01-16 15:51:41.000000000 +0100
+@@ -0,0 +1,21 @@
++#ifndef MPLAYER_STATS_H
++#define MPLAYER_STATS_H
++
++#include <stdint.h>
++
++void stats_init(void);
++void stats_exit(void);
++
++/// CPU usage model
++enum CpuUsageType {
++ CPU_USAGE_QUANTUM = 1, ///< CPU usage since the last call to cpu_get_usage()
++ CPU_USAGE_AVERAGE ///< CPU usage average'd since program start
++};
++
++/// Get CPU frequency
++unsigned int get_cpu_frequency(void);
++
++/// Get CPU usage in percent
++float get_cpu_usage(enum CpuUsageType type);
++
++#endif /* MPLAYER_STATS_H */
+diff -Naur mplayer-1.0_rc4_p20120109/libvo/video_out.c mplayer-1.0_rc4_p20120109-new/libvo/video_out.c
+--- mplayer-1.0_rc4_p20120109/libvo/video_out.c 2012-01-09 14:46:56.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libvo/video_out.c 2012-01-16 15:51:41.000000000 +0100
+@@ -94,6 +94,7 @@
+ extern const vo_functions_t video_out_xmga;
+ extern const vo_functions_t video_out_x11;
+ extern const vo_functions_t video_out_xvmc;
++extern const vo_functions_t video_out_vaapi;
+ extern const vo_functions_t video_out_vdpau;
+ extern const vo_functions_t video_out_xv;
+ extern const vo_functions_t video_out_gl_nosw;
+@@ -297,6 +298,9 @@
+ #ifdef CONFIG_MNG
+ &video_out_mng,
+ #endif
++#if CONFIG_VAAPI
++ &video_out_vaapi,
++#endif
+ NULL
+ };
+
+diff -Naur mplayer-1.0_rc4_p20120109/libvo/video_out.h mplayer-1.0_rc4_p20120109-new/libvo/video_out.h
+--- mplayer-1.0_rc4_p20120109/libvo/video_out.h 2012-01-09 14:46:56.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libvo/video_out.h 2012-01-16 15:51:41.000000000 +0100
+@@ -80,6 +80,10 @@
+
+ #define VOCTRL_UPDATE_SCREENINFO 32
+
++// Return current HW acceleration context
++// void *get_hwaccel_context(void);
++#define VOCTRL_GET_HWACCEL_CONTEXT 33
++
+ // Vo can be used by xover
+ #define VOCTRL_XOVERLAY_SUPPORT 22
+
+diff -Naur mplayer-1.0_rc4_p20120109/libvo/vo_vaapi.c mplayer-1.0_rc4_p20120109-new/libvo/vo_vaapi.c
+--- mplayer-1.0_rc4_p20120109/libvo/vo_vaapi.c 1970-01-01 01:00:00.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/libvo/vo_vaapi.c 2012-01-16 15:51:41.000000000 +0100
+@@ -0,0 +1,2728 @@
++/*
++ * VA API output module
++ *
++ * Copyright (C) 2008-2009 Splitted-Desktop Systems
++ *
++ * This file is part of MPlayer.
++ *
++ * MPlayer is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * MPlayer is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License along
++ * with MPlayer; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++ */
++
++#include "config.h"
++#include "mp_msg.h"
++#include "help_mp.h"
++#include "subopt-helper.h"
++#include "video_out.h"
++#include "video_out_internal.h"
++#include "fastmemcpy.h"
++#include "sub/sub.h"
++#include "sub/eosd.h"
++#include "x11_common.h"
++#include "libavutil/common.h"
++#include "libavcodec/vaapi.h"
++#include "gui/interface.h"
++#include "stats.h"
++#include <stdarg.h>
++
++#if CONFIG_GL
++#include "gl_common.h"
++#include <GL/glu.h>
++#include <GL/glx.h>
++#endif
++
++#include <assert.h>
++#include <X11/Xlib.h>
++#include <X11/Xutil.h>
++#include <va/va_x11.h>
++#if CONFIG_VAAPI_GLX
++#include <va/va_glx.h>
++#endif
++
++#if CONFIG_XRENDER
++#include <X11/extensions/Xrender.h>
++#endif
++
++/* Compatibility glue with upstream libva */
++#ifndef VA_SDS_VERSION
++#define VA_SDS_VERSION 0
++#endif
++
++/* Compatibility glue with VA-API >= 0.30 */
++#ifndef VA_INVALID_ID
++#define VA_INVALID_ID 0xffffffff
++#endif
++#ifndef VA_FOURCC
++#define VA_FOURCC(ch0, ch1, ch2, ch3) \
++ ((uint32_t)(uint8_t)(ch0) | \
++ ((uint32_t)(uint8_t)(ch1) << 8) | \
++ ((uint32_t)(uint8_t)(ch2) << 16) | \
++ ((uint32_t)(uint8_t)(ch3) << 24 ))
++#endif
++#if defined VA_SRC_BT601 && defined VA_SRC_BT709
++# define USE_VAAPI_COLORSPACE 1
++#else
++# define USE_VAAPI_COLORSPACE 0
++#endif
++
++/* Defined to 1 if VA/GLX 'bind' API is available */
++#define USE_VAAPI_GLX_BIND \
++ (VA_MAJOR_VERSION == 0 && \
++ ((VA_MINOR_VERSION == 30 && \
++ VA_MICRO_VERSION == 4 && VA_SDS_VERSION >= 5) || \
++ (VA_MINOR_VERSION == 31 && \
++ VA_MICRO_VERSION == 0 && VA_SDS_VERSION >= 1 && VA_SDS_VERSION < 5)))
++
++/* Compatibility glue with VA-API >= 0.31 */
++#if defined VA_CHECK_VERSION
++#if VA_CHECK_VERSION(0,31,0)
++#define vaPutImage2 vaPutImage
++#define vaAssociateSubpicture2 vaAssociateSubpicture
++#endif
++#endif
++
++/* Compatibility glue with VA-API >= 0.31.1 */
++#ifndef VA_SRC_SMPTE_240
++#define VA_SRC_SMPTE_240 0x00000040
++#endif
++#if defined VA_FILTER_SCALING_MASK
++# define USE_VAAPI_SCALING 1
++#else
++# define USE_VAAPI_SCALING 0
++#endif
++
++static vo_info_t info = {
++ "VA API with X11",
++ "vaapi",
++ "Gwenole Beauchesne <gbeauchesne@splitted-desktop.com>",
++ ""
++};
++
++const LIBVO_EXTERN(vaapi)
++
++/* Numbers of video surfaces */
++#define MAX_OUTPUT_SURFACES 2 /* Maintain synchronisation points in flip_page() */
++#define MAX_VIDEO_SURFACES 21 /* Maintain free surfaces in a queue (use least-recently-used) */
++#define NUM_VIDEO_SURFACES_MPEG2 3 /* 1 decode frame, up to 2 references */
++#define NUM_VIDEO_SURFACES_MPEG4 3 /* 1 decode frame, up to 2 references */
++#define NUM_VIDEO_SURFACES_H264 21 /* 1 decode frame, up to 20 references */
++#define NUM_VIDEO_SURFACES_VC1 3 /* 1 decode frame, up to 2 references */
++
++static void ensure_osd(void);
++static int reset_xrender_specific(void);
++
++typedef void (*draw_alpha_func)(int x0, int y0, int w, int h,
++ unsigned char *src, unsigned char *srca,
++ int stride);
++
++typedef void (*eosd_draw_alpha_func)(unsigned char *src,
++ int src_w, int src_h, int src_stride,
++ int dst_x, int dst_y,
++ uint32_t color);
++
++struct vaapi_surface {
++ VASurfaceID id;
++ VAImage image;
++ int is_bound; /* Flag: image bound to the surface? */
++};
++
++struct vaapi_equalizer {
++ VADisplayAttribute brightness;
++ VADisplayAttribute contrast;
++ VADisplayAttribute hue;
++ VADisplayAttribute saturation;
++};
++
++static int g_is_visible;
++static int g_is_paused;
++static uint32_t g_image_width;
++static uint32_t g_image_height;
++static uint32_t g_image_format;
++static uint32_t g_image_fields;
++static Pixmap g_image_pixmap;
++static struct vo_rect g_output_rect;
++static struct vaapi_surface *g_output_surfaces[MAX_OUTPUT_SURFACES];
++static unsigned int g_output_surface;
++static int g_deint;
++static int g_deint_type;
++static int g_colorspace;
++static unsigned int g_scaling;
++
++static int gl_enabled;
++static int gl_use_tfp;
++#if CONFIG_GL
++static MPGLContext gl_context;
++static int gl_binding;
++static int gl_reflect;
++static int gl_finish;
++static GLuint gl_texture;
++static GLuint gl_font_base;
++static Pixmap gl_pixmap;
++static int gl_visual_attr[] = {
++ GLX_RGBA,
++ GLX_RED_SIZE, 1,
++ GLX_GREEN_SIZE, 1,
++ GLX_BLUE_SIZE, 1,
++ GLX_DOUBLEBUFFER,
++ GL_NONE
++};
++#endif
++
++#if CONFIG_VAAPI_GLX
++static void *gl_surface;
++#endif
++
++static int xr_enabled;
++#if CONFIG_XRENDER
++static Picture xr_video_picture;
++static Picture xr_window_picture;
++#endif
++
++static struct vaapi_context *va_context;
++static VAProfile *va_profiles;
++static int va_num_profiles;
++static VAEntrypoint *va_entrypoints;
++static int va_num_entrypoints;
++static VASurfaceID *va_surface_ids;
++static int va_num_surfaces;
++static struct vaapi_surface **va_free_surfaces;
++static int va_free_surfaces_head_index;
++static int va_free_surfaces_tail_index;
++static VAImageFormat *va_image_formats;
++static int va_num_image_formats;
++static VAImageFormat *va_subpic_formats;
++static unsigned int *va_subpic_flags;
++static int va_num_subpic_formats;
++static VAImage va_osd_image;
++static uint8_t *va_osd_image_data;
++static VASubpictureID va_osd_subpicture;
++static int va_osd_associated;
++static draw_alpha_func va_osd_draw_alpha;
++static uint8_t *va_osd_palette;
++static struct vaapi_equalizer va_equalizer;
++static VAImage va_eosd_image;
++static uint8_t *va_eosd_image_data;
++static VASubpictureID va_eosd_subpicture;
++static int va_eosd_associated;
++static eosd_draw_alpha_func va_eosd_draw_alpha;
++
++///< Flag: direct surface mapping: use mpi->number to select free VA surface?
++static int va_dm;
++
++///< Flag: gather run-time statistics (CPU usage, frequency)
++static int cpu_stats;
++static unsigned int cpu_frequency;
++static float cpu_usage;
++
++// X error trap
++static int x11_error_code = 0;
++static int (*old_error_handler)(Display *, XErrorEvent *);
++
++static int error_handler(Display *dpy, XErrorEvent *error)
++{
++ x11_error_code = error->error_code;
++ return 0;
++}
++
++static void x11_trap_errors(void)
++{
++ x11_error_code = 0;
++ old_error_handler = XSetErrorHandler(error_handler);
++}
++
++static int x11_untrap_errors(void)
++{
++ XSetErrorHandler(old_error_handler);
++ return x11_error_code;
++}
++
++static int check_status(VAStatus status, const char *msg)
++{
++ if (status != VA_STATUS_SUCCESS) {
++ mp_msg(MSGT_VO, MSGL_ERR, "[vo_vaapi] %s: %s\n", msg, vaErrorStr(status));
++ return 0;
++ }
++ return 1;
++}
++
++static const char *string_of_VAImageFormat(VAImageFormat *imgfmt)
++{
++ static char str[5];
++ str[0] = imgfmt->fourcc;
++ str[1] = imgfmt->fourcc >> 8;
++ str[2] = imgfmt->fourcc >> 16;
++ str[3] = imgfmt->fourcc >> 24;
++ str[4] = '\0';
++ return str;
++}
++
++static const char *string_of_VAProfile(VAProfile profile)
++{
++ switch (profile) {
++#define PROFILE(profile) \
++ case VAProfile##profile: return "VAProfile" #profile
++ PROFILE(MPEG2Simple);
++ PROFILE(MPEG2Main);
++ PROFILE(MPEG4Simple);
++ PROFILE(MPEG4AdvancedSimple);
++ PROFILE(MPEG4Main);
++ PROFILE(H264Baseline);
++ PROFILE(H264Main);
++ PROFILE(H264High);
++ PROFILE(VC1Simple);
++ PROFILE(VC1Main);
++ PROFILE(VC1Advanced);
++#undef PROFILE
++ }
++ return "<unknown>";
++}
++
++static const char *string_of_VAEntrypoint(VAEntrypoint entrypoint)
++{
++ switch (entrypoint) {
++#define ENTRYPOINT(entrypoint) \
++ case VAEntrypoint##entrypoint: return "VAEntrypoint" #entrypoint
++ ENTRYPOINT(VLD);
++ ENTRYPOINT(IZZ);
++ ENTRYPOINT(IDCT);
++ ENTRYPOINT(MoComp);
++ ENTRYPOINT(Deblocking);
++#undef ENTRYPOINT
++ }
++ return "<unknown>";
++}
++
++static int has_profile(VAProfile profile)
++{
++ if (va_profiles && va_num_profiles > 0) {
++ int i;
++ for (i = 0; i < va_num_profiles; i++) {
++ if (va_profiles[i] == profile)
++ return 1;
++ }
++ }
++ return 0;
++}
++
++static int VAProfile_from_imgfmt(uint32_t format)
++{
++ static const int mpeg2_profiles[] =
++ { VAProfileMPEG2Main, VAProfileMPEG2Simple, -1 };
++ static const int mpeg4_profiles[] =
++ { VAProfileMPEG4Main, VAProfileMPEG4AdvancedSimple, VAProfileMPEG4Simple, -1 };
++ static const int h264_profiles[] =
++ { VAProfileH264High, VAProfileH264Main, VAProfileH264Baseline, -1 };
++ static const int wmv3_profiles[] =
++ { VAProfileVC1Main, VAProfileVC1Simple, -1 };
++ static const int vc1_profiles[] =
++ { VAProfileVC1Advanced, -1 };
++
++ const int *profiles = NULL;
++ switch (IMGFMT_VAAPI_CODEC(format)) {
++ case IMGFMT_VAAPI_CODEC_MPEG2:
++ profiles = mpeg2_profiles;
++ break;
++ case IMGFMT_VAAPI_CODEC_MPEG4:
++ profiles = mpeg4_profiles;
++ break;
++ case IMGFMT_VAAPI_CODEC_H264:
++ profiles = h264_profiles;
++ break;
++ case IMGFMT_VAAPI_CODEC_VC1:
++ switch (format) {
++ case IMGFMT_VAAPI_WMV3:
++ profiles = wmv3_profiles;
++ break;
++ case IMGFMT_VAAPI_VC1:
++ profiles = vc1_profiles;
++ break;
++ }
++ break;
++ }
++
++ if (profiles) {
++ for (int i = 0; profiles[i] != -1; i++) {
++ if (has_profile(profiles[i]))
++ return profiles[i];
++ }
++ }
++ return -1;
++}
++
++static int has_entrypoint(VAEntrypoint entrypoint)
++{
++ if (va_entrypoints && va_num_entrypoints > 0) {
++ int i;
++ for (i = 0; i < va_num_entrypoints; i++) {
++ if (va_entrypoints[i] == entrypoint)
++ return 1;
++ }
++ }
++ return 0;
++}
++
++static int VAEntrypoint_from_imgfmt(uint32_t format)
++{
++ int entrypoint = 0;
++ switch (format) {
++ case IMGFMT_VAAPI_MPEG2:
++ case IMGFMT_VAAPI_MPEG4:
++ case IMGFMT_VAAPI_H263:
++ case IMGFMT_VAAPI_H264:
++ case IMGFMT_VAAPI_WMV3:
++ case IMGFMT_VAAPI_VC1:
++ entrypoint = VAEntrypointVLD;
++ break;
++ case IMGFMT_VAAPI_MPEG2_IDCT:
++ entrypoint = VAEntrypointIDCT;
++ break;
++ case IMGFMT_VAAPI_MPEG2_MOCO:
++ entrypoint = VAEntrypointMoComp;
++ break;
++ }
++
++ if (entrypoint)
++ return has_entrypoint(entrypoint);
++
++ return -1;
++}
++
++static VAImageFormat *find_image_format(uint32_t fourcc)
++{
++ if (va_image_formats && va_num_image_formats > 0) {
++ int i;
++ for (i = 0; i < va_num_image_formats; i++) {
++ if (va_image_formats[i].fourcc == fourcc)
++ return &va_image_formats[i];
++ }
++ }
++ return NULL;
++}
++
++static VAImageFormat *VAImageFormat_from_imgfmt(uint32_t format)
++{
++ uint32_t fourcc = 0;
++
++ switch (format) {
++ case IMGFMT_NV12: fourcc = VA_FOURCC('N','V','1','2'); break;
++ case IMGFMT_YV12: fourcc = VA_FOURCC('Y','V','1','2'); break;
++ case IMGFMT_I420: fourcc = VA_FOURCC('I','4','2','0'); break;
++ case IMGFMT_IYUV: fourcc = VA_FOURCC('I','Y','U','V'); break;
++ }
++
++ if (fourcc)
++ return find_image_format(fourcc);
++
++ return NULL;
++}
++
++static struct vaapi_surface *alloc_vaapi_surface(unsigned int width,
++ unsigned int height,
++ unsigned int format)
++{
++ struct vaapi_surface *surface = NULL;
++ struct vaapi_surface **surfaces;
++ VASurfaceID *surface_ids;
++ VAStatus status;
++
++ surface = calloc(1, sizeof(*surface));
++ if (!surface)
++ goto error;
++
++ surfaces = realloc(va_free_surfaces,
++ (1 + va_num_surfaces) * sizeof(surfaces[0]));
++ if (!surfaces)
++ goto error;
++
++ surface_ids = realloc(va_surface_ids,
++ (1 + va_num_surfaces) * sizeof(surface_ids[0]));
++ if (!surface_ids)
++ goto error;
++
++ status = vaCreateSurfaces(va_context->display, width, height, format,
++ 1, &surface->id);
++ if (!check_status(status, "vaCreateSurfaces()"))
++ goto error;
++
++ va_surface_ids = surface_ids;
++ va_surface_ids[va_num_surfaces] = surface->id;
++ va_free_surfaces = surfaces;
++ va_free_surfaces[va_num_surfaces] = surface;
++ surface->image.image_id = VA_INVALID_ID;
++ surface->image.buf = VA_INVALID_ID;
++ ++va_num_surfaces;
++ return surface;
++error:
++ free(surface);
++ return NULL;
++}
++
++static void resize(void)
++{
++ struct vo_rect src;
++
++ calc_src_dst_rects(g_image_width, g_image_height,
++ &src, &g_output_rect, NULL, NULL);
++
++ ensure_osd();
++
++ vo_x11_clearwindow(mDisplay, vo_window);
++
++#if CONFIG_GL
++#define FOVY 60.0f
++#define ASPECT 1.0f
++#define Z_NEAR 0.1f
++#define Z_FAR 100.0f
++#define Z_CAMERA 0.869f
++
++ if (gl_enabled) {
++ glViewport(0, 0, vo_dwidth, vo_dheight);
++ glMatrixMode(GL_PROJECTION);
++ glLoadIdentity();
++ gluPerspective(FOVY, ASPECT, Z_NEAR, Z_FAR);
++ glMatrixMode(GL_MODELVIEW);
++ glLoadIdentity();
++
++ glTranslatef(-0.5f, -0.5f, -Z_CAMERA);
++ glScalef(1.0f / (GLfloat)vo_dwidth,
++ -1.0f / (GLfloat)vo_dheight,
++ 1.0f / (GLfloat)vo_dwidth);
++ glTranslatef(0.0f, -1.0f * (GLfloat)vo_dheight, 0.0f);
++ }
++#endif
++
++#if CONFIG_XRENDER
++ if (xr_enabled)
++ reset_xrender_specific();
++#endif
++
++ if (g_is_visible)
++ flip_page();
++}
++
++#if CONFIG_GL
++static int gl_build_font(void)
++{
++ XFontStruct *fi;
++
++ gl_font_base = glGenLists(96);
++
++ fi = XLoadQueryFont(mDisplay, "-adobe-helvetica-medium-r-normal--16-*-*-*-p-*-iso8859-1" );
++ if (!fi) {
++ fi = XLoadQueryFont(mDisplay, "fixed");
++ if (!fi)
++ return -1;
++ }
++
++ glXUseXFont(fi->fid, 32, 96, gl_font_base);
++ XFreeFont(mDisplay, fi);
++ return 0;
++}
++
++static void gl_printf(const char *format, ...)
++{
++ va_list args;
++ char *text;
++ int textlen;
++
++ va_start(args, format);
++ textlen = vsnprintf(NULL, 0, format, args);
++ va_end(args);
++
++ text = malloc(textlen + 1);
++ if (!text)
++ return;
++
++ va_start(args, format);
++ vsprintf(text, format, args);
++ va_end(args);
++
++ glPushAttrib(GL_LIST_BIT);
++ glListBase(gl_font_base - 32);
++ glCallLists(textlen, GL_UNSIGNED_BYTE, text);
++ glPopAttrib();
++ free(text);
++}
++
++static void gl_draw_rectangle(int x, int y, int w, int h, unsigned int rgba)
++{
++ glColor4f((GLfloat)((rgba >> 24) & 0xff) / 255.0,
++ (GLfloat)((rgba >> 16) & 0xff) / 255.0,
++ (GLfloat)((rgba >> 8) & 0xff) / 255.0,
++ (GLfloat)(rgba & 0xff) / 255.0);
++
++ glTranslatef((GLfloat)x, (GLfloat)y, 0.0f);
++ glBegin(GL_QUADS);
++ {
++ glVertex2i(0, 0);
++ glVertex2i(w, 0);
++ glVertex2i(w, h);
++ glVertex2i(0, h);
++ }
++ glEnd();
++}
++#endif
++
++#if CONFIG_XRENDER
++static int init_xrender(void)
++{
++ int dummy;
++
++ return XRenderQueryExtension(mDisplay, &dummy, &dummy);
++}
++
++static void uninit_xrender(void)
++{
++}
++#endif
++
++static inline unsigned char *get_osd_image_data(int x0, int y0)
++{
++ return (va_osd_image_data +
++ va_osd_image.offsets[0] +
++ va_osd_image.pitches[0] * y0 +
++ x0 * ((va_osd_image.format.bits_per_pixel + 7) / 8));
++}
++
++static void draw_alpha_rgb32(int x0, int y0, int w, int h,
++ unsigned char *src, unsigned char *srca,
++ int stride)
++{
++ int x, y;
++ const unsigned int dststride = va_osd_image.pitches[0];
++ unsigned char *dst = get_osd_image_data(x0, y0);
++
++ for (y = 0; y < h; y++, dst += dststride, src += stride, srca += stride)
++ for (x = 0; x < w; x++) {
++ const unsigned char c = src[x];
++ dst[4*x + 0] = c;
++ dst[4*x + 1] = c;
++ dst[4*x + 2] = c;
++ dst[4*x + 3] = -srca[x];
++ }
++}
++
++static void draw_alpha_IA44(int x0, int y0, int w, int h,
++ unsigned char *src, unsigned char *srca,
++ int stride)
++{
++ int x, y;
++ const unsigned int dststride = va_osd_image.pitches[0];
++ unsigned char *dst = get_osd_image_data(x0, y0);
++
++ for (y = 0; y < h; y++, dst += dststride)
++ for (x = 0; x < w; x++)
++ dst[x] = (src[y*stride + x] >> 4) | (-srca[y*stride + x] & 0xf0);
++}
++
++static void draw_alpha_AI44(int x0, int y0, int w, int h,
++ unsigned char *src, unsigned char *srca,
++ int stride)
++{
++ int x, y;
++ const unsigned int dststride = va_osd_image.pitches[0];
++ unsigned char *dst = get_osd_image_data(x0, y0);
++
++ for (y = 0; y < h; y++, dst += dststride)
++ for (x = 0; x < w; x++)
++ dst[x] = (src[y*stride + x] & 0xf0) | (-srca[y*stride + x] >> 4);
++}
++
++static void draw_alpha_IA88(int x0, int y0, int w, int h,
++ unsigned char *src, unsigned char *srca,
++ int stride)
++{
++ int x, y;
++ const unsigned int dststride = va_osd_image.pitches[0];
++ unsigned char *dst = get_osd_image_data(x0, y0);
++
++ for (y = 0; y < h; y++, dst += dststride)
++ for (x = 0; x < w; x++) {
++ dst[2*x + 0] = src [y*stride + x];
++ dst[2*x + 1] = -srca[y*stride + x];
++ }
++}
++
++static void draw_alpha_AI88(int x0, int y0, int w, int h,
++ unsigned char *src, unsigned char *srca,
++ int stride)
++{
++ int x, y;
++ const unsigned int dststride = va_osd_image.pitches[0];
++ unsigned char *dst = get_osd_image_data(x0, y0);
++
++ for (y = 0; y < h; y++, dst += dststride)
++ for (x = 0; x < w; x++) {
++ dst[2*x + 0] = -srca[y*stride + x];
++ dst[2*x + 1] = src [y*stride + x];
++ }
++}
++
++///< List of subpicture formats in preferred order
++static const struct {
++ uint32_t format;
++ draw_alpha_func draw_alpha;
++}
++va_osd_info[] = {
++ { VA_FOURCC('I','A','4','4'), draw_alpha_IA44 },
++ { VA_FOURCC('A','I','4','4'), draw_alpha_AI44 },
++ { VA_FOURCC('I','A','8','8'), draw_alpha_IA88 },
++ { VA_FOURCC('A','I','8','8'), draw_alpha_AI88 },
++ { VA_FOURCC('B','G','R','A'), draw_alpha_rgb32 },
++ { VA_FOURCC('R','G','B','A'), draw_alpha_rgb32 },
++ { 0, NULL }
++};
++
++static uint8_t *gen_osd_palette(const VAImage *image)
++{
++ uint8_t *palette;
++ int i, is_rgb;
++ int r_idx = -1, g_idx = -1, b_idx = -1;
++ int y_idx = -1, u_idx = -1, v_idx = -1;
++ int i_idx = -1, a_idx = -1;
++
++ if (image->num_palette_entries < 1)
++ return NULL;
++
++ palette = malloc(image->num_palette_entries * image->entry_bytes);
++ if (!palette)
++ return NULL;
++
++ for (i = 0; i < image->entry_bytes; i++) {
++ switch (image->component_order[i]) {
++ case 'R': r_idx = i; is_rgb = 1; break;
++ case 'G': g_idx = i; is_rgb = 1; break;
++ case 'B': b_idx = i; is_rgb = 1; break;
++ case 'Y': y_idx = i; is_rgb = 0; break;
++ case 'U': u_idx = i; is_rgb = 0; break;
++ case 'V': v_idx = i; is_rgb = 0; break;
++ case 'I': i_idx = i; break;
++ case 'A': a_idx = i; break;
++ }
++ }
++
++ if (r_idx != -1 && g_idx != -1 && b_idx != -1) { /* RGB format */
++ for (i = 0; i < image->num_palette_entries; i++) {
++ const int n = i * image->entry_bytes;
++ palette[n + r_idx] = i * 0xff / (image->num_palette_entries - 1);
++ palette[n + g_idx] = i * 0xff / (image->num_palette_entries - 1);
++ palette[n + b_idx] = i * 0xff / (image->num_palette_entries - 1);
++ }
++ }
++ else if (y_idx != -1 && u_idx != -1 && v_idx != -1) { /* YUV format */
++ for (i = 0; i < image->num_palette_entries; i++) {
++ const int n = i * image->entry_bytes;
++ palette[n + y_idx] = i * 0xff / (image->num_palette_entries - 1);
++ palette[n + u_idx] = 0x80;
++ palette[n + v_idx] = 0x80;
++ }
++ }
++ else if (i_idx != -1 && a_idx != -1) {/* AYUV format (GMA500 "psb" bug) */
++ for (i = 0; i < image->num_palette_entries; i++) {
++ const int n = i * image->entry_bytes;
++ palette[n + 0] = 0x80;
++ palette[n + 1] = 0x80;
++ palette[n + 2] = 16 + i * 220 / (image->num_palette_entries - 1);
++ palette[n + 3] = 0;
++ }
++ }
++ else {
++ mp_msg(MSGT_VO, MSGL_ERR, "[vo_vaapi] Could not set up subpicture palette\n");
++ free(palette);
++ palette = NULL;
++ }
++ return palette;
++}
++
++static void disable_osd(void)
++{
++ if (!va_osd_associated)
++ return;
++
++ vaDeassociateSubpicture(va_context->display,
++ va_osd_subpicture,
++ va_surface_ids, va_num_surfaces);
++
++ va_osd_associated = 0;
++}
++
++static int enable_osd(void)
++{
++ VAStatus status;
++
++ disable_osd();
++
++ status = vaAssociateSubpicture2(va_context->display,
++ va_osd_subpicture,
++ va_surface_ids, va_num_surfaces,
++ 0, 0,
++ va_osd_image.width, va_osd_image.height,
++ 0, 0,
++ g_image_width, g_image_height,
++ 0);
++ if (!check_status(status, "vaAssociateSubpicture()"))
++ return -1;
++
++ va_osd_associated = 1;
++ return 0;
++}
++
++static void destroy_osd(void)
++{
++ disable_osd();
++
++ if (va_osd_subpicture != VA_INVALID_ID) {
++ vaDestroySubpicture(va_context->display, va_osd_subpicture);
++ va_osd_subpicture = VA_INVALID_ID;
++ }
++
++ if (va_osd_image.image_id != VA_INVALID_ID) {
++ vaDestroyImage(va_context->display, va_osd_image.image_id);
++ va_osd_image.image_id = VA_INVALID_ID;
++ va_osd_image.width = 0;
++ va_osd_image.height = 0;
++ }
++}
++
++static void create_osd(void)
++{
++ VAStatus status;
++ int i, j;
++
++ for (i = 0; va_osd_info[i].format; i++) {
++ for (j = 0; j < va_num_subpic_formats; j++)
++ if (va_subpic_formats[j].fourcc == va_osd_info[i].format)
++ break;
++ if (j < va_num_subpic_formats &&
++ vaCreateImage(va_context->display, &va_subpic_formats[j],
++ g_output_rect.width, g_output_rect.height,
++ &va_osd_image) == VA_STATUS_SUCCESS) {
++ va_osd_palette = gen_osd_palette(&va_osd_image);
++ if (((!va_osd_image.num_palette_entries) ^ (!va_osd_palette)) == 0)
++ break;
++ vaDestroyImage(va_context->display, va_osd_image.image_id);
++ va_osd_image.image_id = VA_INVALID_ID;
++ }
++ }
++
++ if (va_osd_info[i].format &&
++ vaCreateSubpicture(va_context->display, va_osd_image.image_id,
++ &va_osd_subpicture) == VA_STATUS_SUCCESS) {
++ va_osd_draw_alpha = va_osd_info[i].draw_alpha;
++ if (va_osd_palette) {
++ status = vaSetImagePalette(va_context->display,
++ va_osd_image.image_id, va_osd_palette);
++ check_status(status, "vaSetImagePalette()");
++ }
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] Using %s surface for OSD\n",
++ string_of_VAImageFormat(&va_osd_image.format));
++ }
++}
++
++static void ensure_osd(void)
++{
++ if (g_output_rect.width == va_osd_image.width &&
++ g_output_rect.height == va_osd_image.height)
++ return;
++
++ destroy_osd();
++ create_osd();
++}
++
++static inline unsigned char *get_eosd_image_data(int x0, int y0)
++{
++ return (va_eosd_image_data +
++ va_eosd_image.offsets[0] +
++ va_eosd_image.pitches[0] * y0 +
++ x0 * ((va_eosd_image.format.bits_per_pixel + 7) / 8));
++}
++
++static void eosd_draw_alpha_bgra(unsigned char *src,
++ int src_w, int src_h, int src_stride,
++ int dst_x, int dst_y,
++ uint32_t color)
++{
++ int x, y;
++ const unsigned int dst_stride = va_eosd_image.pitches[0];
++ unsigned char *dst = get_eosd_image_data(dst_x, dst_y);
++ const unsigned int r = (color >> 24) & 0xff;
++ const unsigned int g = (color >> 16) & 0xff;
++ const unsigned int b = (color >> 8) & 0xff;
++ const unsigned int a = 0xff - (color & 0xff);
++
++ for (y = 0; y < src_h; y++, dst += dst_stride, src += src_stride)
++ for (x = 0; x < src_w; x++) {
++ const unsigned int v = src[x];
++ dst[4*x + 0] = (b * v + dst[4*x + 0] * (0xff - v)) / 255;
++ dst[4*x + 1] = (g * v + dst[4*x + 1] * (0xff - v)) / 255;
++ dst[4*x + 2] = (r * v + dst[4*x + 2] * (0xff - v)) / 255;
++ dst[4*x + 3] = (a * v + dst[4*x + 3] * (0xff - v)) / 255;
++ }
++}
++
++static void eosd_draw_alpha_rgba(unsigned char *src,
++ int src_w, int src_h, int src_stride,
++ int dst_x, int dst_y,
++ uint32_t color)
++{
++ int x, y;
++ const unsigned int dst_stride = va_eosd_image.pitches[0];
++ unsigned char *dst = get_eosd_image_data(dst_x, dst_y);
++ const unsigned int r = (color >> 24) & 0xff;
++ const unsigned int g = (color >> 16) & 0xff;
++ const unsigned int b = (color >> 8) & 0xff;
++ const unsigned int a = 0xff - (color & 0xff);
++
++ for (y = 0; y < src_h; y++, dst += dst_stride, src += src_stride)
++ for (x = 0; x < src_w; x++) {
++ const unsigned int v = src[x];
++ dst[4*x + 0] = (r * v + dst[4*x + 0] * (0xff - v)) / 255;
++ dst[4*x + 1] = (g * v + dst[4*x + 1] * (0xff - v)) / 255;
++ dst[4*x + 2] = (b * v + dst[4*x + 2] * (0xff - v)) / 255;
++ dst[4*x + 3] = (a * v + dst[4*x + 3] * (0xff - v)) / 255;
++ }
++}
++
++static void disable_eosd(void)
++{
++ if (!va_eosd_associated)
++ return;
++
++ vaDeassociateSubpicture(va_context->display,
++ va_eosd_subpicture,
++ va_surface_ids, va_num_surfaces);
++
++ va_eosd_associated = 0;
++}
++
++static int enable_eosd(void)
++{
++ VAStatus status;
++
++ if (va_eosd_associated)
++ return 0;
++
++ status = vaAssociateSubpicture2(va_context->display,
++ va_eosd_subpicture,
++ va_surface_ids, va_num_surfaces,
++ 0, 0, g_image_width, g_image_height,
++ 0, 0, g_image_width, g_image_height,
++ 0);
++ if (!check_status(status, "vaAssociateSubpicture()"))
++ return -1;
++
++ va_eosd_associated = 1;
++ return 0;
++}
++
++///< List of subpicture formats in preferred order
++static const struct {
++ uint32_t format;
++ eosd_draw_alpha_func draw_alpha;
++}
++va_eosd_info[] = {
++ { VA_FOURCC('B','G','R','A'), eosd_draw_alpha_bgra },
++ { VA_FOURCC('R','G','B','A'), eosd_draw_alpha_rgba },
++ { 0, NULL }
++};
++
++static int is_direct_mapping_init(void)
++{
++ VADisplayAttribute attr;
++ VAStatus status;
++
++ if (va_dm < 2)
++ return va_dm;
++
++ /* If the driver doesn't make a copy of the VA surface for
++ display, then we have to retain it until it's no longer the
++ visible surface. In other words, if the driver is using
++ DirectSurface mode, we don't want to decode the new surface
++ into the previous one that was used for display. */
++ attr.type = VADisplayAttribDirectSurface;
++ attr.flags = VA_DISPLAY_ATTRIB_GETTABLE;
++
++ status = vaGetDisplayAttributes(va_context->display, &attr, 1);
++ if (status == VA_STATUS_SUCCESS)
++ return !attr.value;
++ return 0;
++}
++
++static inline int is_direct_mapping(void)
++{
++ static int dm = -1;
++ if (dm < 0) {
++ dm = is_direct_mapping_init();
++ if (dm)
++ mp_msg(MSGT_VO, MSGL_INFO,
++ "[vo_vaapi] Using 1:1 VA surface mapping\n");
++ }
++ return dm;
++}
++
++static int int_012(int *n)
++{
++ return *n >= 0 && *n <= 2;
++}
++
++#if USE_VAAPI_SCALING
++static strarg_t g_scaling_arg = { 0, NULL };
++
++static int test_scaling_arg(void *arg)
++{
++ strarg_t * const strarg = arg;
++
++ return (strargcmp(strarg, "default") == 0 ||
++ strargcmp(strarg, "fast") == 0 ||
++ strargcmp(strarg, "hq") == 0);
++}
++
++static void setup_scaling(const char *scaling)
++{
++ if (strcmp(scaling, "default") == 0)
++ g_scaling = VA_FILTER_SCALING_DEFAULT;
++ else if (strcmp(scaling, "fast") == 0)
++ g_scaling = VA_FILTER_SCALING_FAST;
++ else if (strcmp(scaling, "hq") == 0)
++ g_scaling = VA_FILTER_SCALING_HQ;
++ else if (strcmp(scaling, "nla") == 0)
++ g_scaling = VA_FILTER_SCALING_NL_ANAMORPHIC;
++}
++#endif
++
++static const opt_t subopts[] = {
++ { "dm", OPT_ARG_INT, &va_dm, (opt_test_f)int_012 },
++ { "stats", OPT_ARG_BOOL, &cpu_stats, NULL },
++ { "deint", OPT_ARG_INT, &g_deint, (opt_test_f)int_012 },
++#if USE_VAAPI_COLORSPACE
++ { "colorspace", OPT_ARG_INT, &g_colorspace, (opt_test_f)int_012 },
++#endif
++#if USE_VAAPI_SCALING
++ { "scaling", OPT_ARG_STR, &g_scaling_arg, test_scaling_arg },
++#endif
++#if CONFIG_GL
++ { "gl", OPT_ARG_BOOL, &gl_enabled, NULL },
++ { "glfinish", OPT_ARG_BOOL, &gl_finish, NULL },
++#if USE_VAAPI_GLX_BIND
++ { "bind", OPT_ARG_BOOL, &gl_binding, NULL },
++#endif
++ { "reflect", OPT_ARG_BOOL, &gl_reflect, NULL },
++ { "tfp", OPT_ARG_BOOL, &gl_use_tfp, NULL },
++#endif
++#if CONFIG_XRENDER
++ { "xrender", OPT_ARG_BOOL, &xr_enabled, NULL },
++#endif
++ { NULL, }
++};
++
++static int preinit(const char *arg)
++{
++ VADisplayAttribute *display_attrs;
++ VAStatus status;
++ int va_major_version, va_minor_version;
++ int i, max_image_formats, max_subpic_formats, max_profiles;
++ int num_display_attrs, max_display_attrs;
++
++ va_dm = 2;
++ g_deint = 0;
++ g_deint_type = 2;
++ g_colorspace = 1;
++ g_scaling = 0;
++ if (subopt_parse(arg, subopts) != 0) {
++ mp_msg(MSGT_VO, MSGL_FATAL,
++ "\n-vo vaapi command line help:\n"
++ "Example: mplayer -vo vaapi:gl\n"
++ "\nOptions:\n"
++ " dm\n"
++ " 0: use least-recently-used VA surface\n"
++ " 1: identify VA surface with MPI index\n"
++ " 2: auto-detect use of direct surface mapping (default)\n"
++ " deint (all modes > 0 respect -field-dominance)\n"
++ " 0: no deinterlacing (default)\n"
++ " 1: only show first field\n"
++ " 2: bob deinterlacing\n"
++#if USE_VAAPI_COLORSPACE
++ " colorspace\n"
++ " 0: guess based on video resolution\n"
++ " 1: ITU-R BT.601 (default)\n"
++ " 2: ITU-R BT.709\n"
++ " 3: SMPTE-240M\n"
++#endif
++#if USE_VAAPI_SCALING
++ " scaling\n"
++ " default: use implementation default (default)\n"
++ " fast: use fast scaling, but possibly with less quality\n"
++ " hq: use high-quality scaling, but possibly slower\n"
++ " nla: use non-linear anamorphic scaling\n"
++#endif
++#if CONFIG_GL
++ " gl\n"
++ " Enable OpenGL rendering\n"
++ " glfinish\n"
++ " Call glFinish() before swapping buffers\n"
++ " tfp\n"
++ " Use GLX texture-from-pixmap instead of VA/GLX extensions\n"
++#if USE_VAAPI_GLX_BIND
++ " bind\n"
++ " Use VA surface binding instead of copy\n"
++#endif
++ " reflect\n"
++ " Enable OpenGL reflection effects\n"
++#endif
++#if CONFIG_XRENDER
++ " xrender\n"
++ " Enable Xrender rendering, thus vaPutSurface() to a Pixmap\n"
++#endif
++ "\n" );
++ return -1;
++ }
++ if (gl_enabled && xr_enabled) {
++ mp_msg(MSGT_VO, MSGL_ERR, "[vo_vaapi] User requested both Xrender and OpenGL rendering\n");
++ return -1;
++ }
++ if (g_deint)
++ g_deint_type = g_deint;
++#if CONFIG_GL
++ if (gl_enabled)
++ mp_msg(MSGT_VO, MSGL_INFO, "[vo_vaapi] Using OpenGL rendering%s\n",
++ gl_reflect ? ", with reflection effects" : "");
++#endif
++#if CONFIG_XRENDER
++ if (xr_enabled)
++ mp_msg(MSGT_VO, MSGL_INFO, "[vo_vaapi] Using Xrender rendering\n");
++#endif
++#if USE_VAAPI_SCALING
++ if (g_scaling_arg.str) {
++ mp_msg(MSGT_VO, MSGL_INFO, "[vo_vaapi] Using '%s' scaling\n", g_scaling_arg.str);
++ setup_scaling(g_scaling_arg.str);
++ }
++#endif
++
++ stats_init();
++
++#if CONFIG_GL
++ if (gl_enabled && !init_mpglcontext(&gl_context, GLTYPE_X11))
++ return -1;
++ else
++#endif
++ if (!vo_init())
++ return -1;
++#if CONFIG_XRENDER
++ if (xr_enabled && !init_xrender())
++ return -1;
++#endif
++
++ va_context = calloc(1, sizeof(*va_context));
++ if (!va_context)
++ return -1;
++
++#if CONFIG_VAAPI_GLX
++ if (gl_enabled)
++ va_context->display = vaGetDisplayGLX(mDisplay);
++ else
++#endif
++ va_context->display = vaGetDisplay(mDisplay);
++ if (!va_context->display)
++ return -1;
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] preinit(): VA display %p\n", va_context->display);
++
++ status = vaInitialize(va_context->display, &va_major_version, &va_minor_version);
++ if (!check_status(status, "vaInitialize()"))
++ return -1;
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] preinit(): VA API version %d.%d\n",
++ va_major_version, va_minor_version);
++
++ max_image_formats = vaMaxNumImageFormats(va_context->display);
++ va_image_formats = calloc(max_image_formats, sizeof(*va_image_formats));
++ if (!va_image_formats)
++ return -1;
++ status = vaQueryImageFormats(va_context->display, va_image_formats, &va_num_image_formats);
++ if (!check_status(status, "vaQueryImageFormats()"))
++ return -1;
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] preinit(): %d image formats available\n",
++ va_num_image_formats);
++ for (i = 0; i < va_num_image_formats; i++)
++ mp_msg(MSGT_VO, MSGL_DBG2, " %s\n", string_of_VAImageFormat(&va_image_formats[i]));
++
++ max_subpic_formats = vaMaxNumSubpictureFormats(va_context->display);
++ va_subpic_formats = calloc(max_subpic_formats, sizeof(*va_subpic_formats));
++ if (!va_subpic_formats)
++ return -1;
++ va_subpic_flags = calloc(max_subpic_formats, sizeof(*va_subpic_flags));
++ if (!va_subpic_flags)
++ return -1;
++ status = vaQuerySubpictureFormats(va_context->display, va_subpic_formats, va_subpic_flags, &va_num_subpic_formats);
++ if (!check_status(status, "vaQuerySubpictureFormats()"))
++ va_num_subpic_formats = 0; /* XXX: don't error out for IEGD */
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] preinit(): %d subpicture formats available\n",
++ va_num_subpic_formats);
++ for (i = 0; i < va_num_subpic_formats; i++)
++ mp_msg(MSGT_VO, MSGL_DBG2, " %s, flags 0x%x\n", string_of_VAImageFormat(&va_subpic_formats[i]), va_subpic_flags[i]);
++
++ max_profiles = vaMaxNumProfiles(va_context->display);
++ va_profiles = calloc(max_profiles, sizeof(*va_profiles));
++ if (!va_profiles)
++ return -1;
++ status = vaQueryConfigProfiles(va_context->display, va_profiles, &va_num_profiles);
++ if (!check_status(status, "vaQueryConfigProfiles()"))
++ return -1;
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] preinit(): %d profiles available\n",
++ va_num_profiles);
++ for (i = 0; i < va_num_profiles; i++)
++ mp_msg(MSGT_VO, MSGL_DBG2, " %s\n", string_of_VAProfile(va_profiles[i]));
++
++ va_osd_subpicture = VA_INVALID_ID;
++ va_osd_image.image_id = VA_INVALID_ID;
++ va_eosd_subpicture = VA_INVALID_ID;
++ va_eosd_image.image_id = VA_INVALID_ID;
++
++ max_display_attrs = vaMaxNumDisplayAttributes(va_context->display);
++ display_attrs = calloc(max_display_attrs, sizeof(*display_attrs));
++ if (display_attrs) {
++ num_display_attrs = 0;
++ status = vaQueryDisplayAttributes(va_context->display,
++ display_attrs, &num_display_attrs);
++ if (check_status(status, "vaQueryDisplayAttributes()")) {
++ for (i = 0; i < num_display_attrs; i++) {
++ VADisplayAttribute *attr;
++ switch (display_attrs[i].type) {
++ case VADisplayAttribBrightness:
++ attr = &va_equalizer.brightness;
++ break;
++ case VADisplayAttribContrast:
++ attr = &va_equalizer.contrast;
++ break;
++ case VADisplayAttribHue:
++ attr = &va_equalizer.hue;
++ break;
++ case VADisplayAttribSaturation:
++ attr = &va_equalizer.saturation;
++ break;
++ default:
++ attr = NULL;
++ break;
++ }
++ if (attr)
++ *attr = display_attrs[i];
++ }
++ }
++ free(display_attrs);
++ }
++ return 0;
++}
++
++static void free_video_specific(void)
++{
++ int i;
++
++#if CONFIG_VAAPI_GLX
++ if (gl_surface) {
++ VAStatus status;
++ status = vaDestroySurfaceGLX(va_context->display, gl_surface);
++ check_status(status, "vaDestroySurfaceGLX()");
++ gl_surface = NULL;
++ }
++#endif
++
++ if (va_context && va_context->context_id) {
++ vaDestroyContext(va_context->display, va_context->context_id);
++ va_context->context_id = 0;
++ }
++
++ if (va_free_surfaces) {
++ for (i = 0; i < va_num_surfaces; i++) {
++ if (!va_free_surfaces[i])
++ continue;
++ if (va_free_surfaces[i]->image.image_id != VA_INVALID_ID) {
++ vaDestroyImage(va_context->display,
++ va_free_surfaces[i]->image.image_id);
++ va_free_surfaces[i]->image.image_id = VA_INVALID_ID;
++ }
++ free(va_free_surfaces[i]);
++ va_free_surfaces[i] = NULL;
++ }
++ free(va_free_surfaces);
++ va_free_surfaces = NULL;
++ va_free_surfaces_head_index = 0;
++ va_free_surfaces_tail_index = 0;
++ }
++
++ g_output_surface = 0;
++ memset(g_output_surfaces, 0, sizeof(g_output_surfaces));
++
++ if (va_osd_palette) {
++ free(va_osd_palette);
++ va_osd_palette = NULL;
++ }
++
++ disable_eosd();
++ disable_osd();
++
++ if (va_eosd_subpicture != VA_INVALID_ID) {
++ vaDestroySubpicture(va_context->display, va_eosd_subpicture);
++ va_eosd_subpicture = VA_INVALID_ID;
++ }
++
++ if (va_eosd_image.image_id != VA_INVALID_ID) {
++ vaDestroyImage(va_context->display, va_eosd_image.image_id);
++ va_eosd_image.image_id = VA_INVALID_ID;
++ }
++
++ destroy_osd();
++
++ if (va_surface_ids) {
++ vaDestroySurfaces(va_context->display, va_surface_ids, va_num_surfaces);
++ free(va_surface_ids);
++ va_surface_ids = NULL;
++ va_num_surfaces = 0;
++ }
++
++ if (va_context && va_context->config_id) {
++ vaDestroyConfig(va_context->display, va_context->config_id);
++ va_context->config_id = 0;
++ }
++
++ if (va_entrypoints) {
++ free(va_entrypoints);
++ va_entrypoints = NULL;
++ }
++
++#if CONFIG_GL
++ if (gl_pixmap) {
++ x11_trap_errors();
++ mpglXDestroyPixmap(mDisplay, gl_pixmap);
++ XSync(mDisplay, False);
++ x11_untrap_errors();
++ gl_pixmap = None;
++ }
++
++ if (g_image_pixmap) {
++ XFreePixmap(mDisplay, g_image_pixmap);
++ g_image_pixmap = None;
++ }
++
++ if (gl_texture) {
++ glDeleteTextures(1, &gl_texture);
++ gl_texture = GL_NONE;
++ }
++#endif
++
++#if CONFIG_XRENDER
++ if (xr_window_picture) {
++ XRenderFreePicture(mDisplay, xr_window_picture);
++ xr_window_picture = None;
++ }
++#endif
++
++ g_is_visible = 0;
++}
++
++static void uninit(void)
++{
++ if (!vo_config_count)
++ return;
++
++ free_video_specific();
++
++ if (va_profiles) {
++ free(va_profiles);
++ va_profiles = NULL;
++ }
++
++ if (va_subpic_flags) {
++ free(va_subpic_flags);
++ va_subpic_flags = NULL;
++ }
++
++ if (va_subpic_formats) {
++ free(va_subpic_formats);
++ va_subpic_formats = NULL;
++ }
++
++ if (va_image_formats) {
++ free(va_image_formats);
++ va_image_formats = NULL;
++ }
++
++ if (va_context && va_context->display) {
++ vaTerminate(va_context->display);
++ va_context->display = NULL;
++ }
++
++ if (va_context) {
++ free(va_context);
++ va_context = NULL;
++ }
++
++#ifdef CONFIG_XF86VM
++ vo_vm_close();
++#endif
++#if CONFIG_XRENDER
++ if (xr_enabled)
++ uninit_xrender();
++#endif
++#if CONFIG_GL
++ if (gl_enabled)
++ uninit_mpglcontext(&gl_context);
++ else
++#endif
++ vo_x11_uninit();
++
++ stats_exit();
++}
++
++static int config_x11(uint32_t width, uint32_t height,
++ uint32_t display_width, uint32_t display_height,
++ uint32_t flags, char *title)
++{
++ Colormap cmap;
++ XVisualInfo visualInfo;
++ XVisualInfo *vi;
++ XSetWindowAttributes xswa;
++ unsigned long xswa_mask;
++ XWindowAttributes wattr;
++ int depth;
++
++#ifdef CONFIG_GUI
++ if (use_gui)
++ guiGetEvent(guiSetShVideo, 0); // the GUI will set up / resize our window
++ else
++#endif
++ {
++#ifdef CONFIG_XF86VM
++ if (flags & VOFLAG_MODESWITCHING)
++ vo_vm_switch();
++#endif
++ XGetWindowAttributes(mDisplay, DefaultRootWindow(mDisplay), &wattr);
++ depth = wattr.depth;
++ if (depth != 15 && depth != 16 && depth != 24 && depth != 32)
++ depth = 24;
++ XMatchVisualInfo(mDisplay, mScreen, depth, TrueColor, &visualInfo);
++
++#if CONFIG_GL
++ if (gl_enabled) {
++ vi = glXChooseVisual(mDisplay, mScreen, gl_visual_attr);
++ if (!vi)
++ return -1;
++ cmap = XCreateColormap(mDisplay, mRootWin, vi->visual, AllocNone);
++ if (cmap == None)
++ return -1;
++ }
++ else
++#endif
++ {
++ vi = &visualInfo;
++ XMatchVisualInfo(mDisplay, mScreen, depth, TrueColor, vi);
++ cmap = CopyFromParent;
++ }
++
++ vo_x11_create_vo_window(vi,
++ vo_dx, vo_dy, display_width, display_height,
++ flags, cmap, "vaapi", title);
++
++ if (vi != &visualInfo)
++ XFree(vi);
++
++ xswa_mask = CWBorderPixel | CWBackPixel;
++ xswa.border_pixel = 0;
++ xswa.background_pixel = 0;
++ XChangeWindowAttributes(mDisplay, vo_window, xswa_mask, &xswa);
++
++#ifdef CONFIG_XF86VM
++ if (flags & VOFLAG_MODESWITCHING) {
++ /* Grab the mouse pointer in our window */
++ if (vo_grabpointer)
++ XGrabPointer(mDisplay, vo_window, True, 0,
++ GrabModeAsync, GrabModeAsync,
++ vo_window, None, CurrentTime);
++ XSetInputFocus(mDisplay, vo_window, RevertToNone, CurrentTime);
++ }
++#endif
++ }
++ return 0;
++}
++
++#if CONFIG_GL
++static GLXFBConfig *get_fbconfig_for_depth(int depth)
++{
++ GLXFBConfig *fbconfigs, *ret = NULL;
++ int n_elements, i, found;
++ int db, stencil, alpha, mipmap, rgba, value;
++
++ static GLXFBConfig *cached_config = NULL;
++ static int have_cached_config = 0;
++
++ if (have_cached_config)
++ return cached_config;
++
++ fbconfigs = glXGetFBConfigs(mDisplay, mScreen, &n_elements);
++
++ db = SHRT_MAX;
++ stencil = SHRT_MAX;
++ mipmap = 0;
++ rgba = 0;
++
++ found = n_elements;
++
++ for (i = 0; i < n_elements; i++) {
++ XVisualInfo *vi;
++ int visual_depth;
++
++ vi = glXGetVisualFromFBConfig(mDisplay, fbconfigs[i]);
++ if (!vi)
++ continue;
++
++ visual_depth = vi->depth;
++ XFree(vi);
++
++ if (visual_depth != depth)
++ continue;
++
++ glXGetFBConfigAttrib(mDisplay, fbconfigs[i], GLX_ALPHA_SIZE, &alpha);
++ glXGetFBConfigAttrib(mDisplay, fbconfigs[i], GLX_BUFFER_SIZE, &value);
++ if (value != depth && (value - alpha) != depth)
++ continue;
++
++ value = 0;
++ if (depth == 32) {
++ glXGetFBConfigAttrib(mDisplay, fbconfigs[i],
++ GLX_BIND_TO_TEXTURE_RGBA_EXT, &value);
++ if (value)
++ rgba = 1;
++ }
++
++ if (!value) {
++ if (rgba)
++ continue;
++
++ glXGetFBConfigAttrib(mDisplay, fbconfigs[i],
++ GLX_BIND_TO_TEXTURE_RGB_EXT, &value);
++ if (!value)
++ continue;
++ }
++
++ glXGetFBConfigAttrib(mDisplay, fbconfigs[i], GLX_DOUBLEBUFFER, &value);
++ if (value > db)
++ continue;
++ db = value;
++
++ glXGetFBConfigAttrib(mDisplay, fbconfigs[i], GLX_STENCIL_SIZE, &value);
++ if (value > stencil)
++ continue;
++ stencil = value;
++
++ found = i;
++ }
++
++ if (found != n_elements) {
++ ret = malloc(sizeof(*ret));
++ *ret = fbconfigs[found];
++ }
++
++ if (n_elements)
++ XFree(fbconfigs);
++
++ have_cached_config = 1;
++ cached_config = ret;
++ return ret;
++}
++
++static int config_tfp(unsigned int width, unsigned int height)
++{
++ GLXFBConfig *fbconfig;
++ int attribs[7], i = 0;
++ const int depth = 24;
++
++ if (!mpglXBindTexImage || !mpglXReleaseTexImage) {
++ mp_msg(MSGT_VO, MSGL_ERR, "[vo_vaapi] No GLX texture-from-pixmap extension available\n");
++ return -1;
++ }
++
++ if (depth != 24 && depth != 32)
++ return -1;
++
++ g_image_pixmap = XCreatePixmap(mDisplay, vo_window, width, height, depth);
++ if (!g_image_pixmap) {
++ mp_msg(MSGT_VO, MSGL_ERR, "[vo_vaapi] Could not create X11 pixmap\n");
++ return -1;
++ }
++
++ fbconfig = get_fbconfig_for_depth(depth);
++ if (!fbconfig) {
++ mp_msg(MSGT_VO, MSGL_ERR, "[vo_vaapi] Could not find an FBConfig for 32-bit pixmap\n");
++ return -1;
++ }
++
++ attribs[i++] = GLX_TEXTURE_TARGET_EXT;
++ attribs[i++] = GLX_TEXTURE_2D_EXT;
++ attribs[i++] = GLX_TEXTURE_FORMAT_EXT;
++ if (depth == 24)
++ attribs[i++] = GLX_TEXTURE_FORMAT_RGB_EXT;
++ else if (depth == 32)
++ attribs[i++] = GLX_TEXTURE_FORMAT_RGBA_EXT;
++ attribs[i++] = GLX_MIPMAP_TEXTURE_EXT;
++ attribs[i++] = GL_FALSE;
++ attribs[i++] = None;
++
++ x11_trap_errors();
++ gl_pixmap = mpglXCreatePixmap(mDisplay, *fbconfig, g_image_pixmap, attribs);
++ XSync(mDisplay, False);
++ if (x11_untrap_errors()) {
++ mp_msg(MSGT_VO, MSGL_ERR, "[vo_vaapi] Could not create GLX pixmap\n");
++ return -1;
++ }
++ return 0;
++}
++
++static int config_glx(unsigned int width, unsigned int height)
++{
++ if (gl_context.setGlWindow(&gl_context) == SET_WINDOW_FAILED)
++ return -1;
++
++ glDisable(GL_DEPTH_TEST);
++ glDepthMask(GL_FALSE);
++ glDisable(GL_CULL_FACE);
++ glEnable(GL_TEXTURE_2D);
++ glDrawBuffer(vo_doublebuffering ? GL_BACK : GL_FRONT);
++ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
++ glEnable(GL_BLEND);
++ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
++
++ /* Create TFP resources */
++ if (gl_use_tfp && config_tfp(width, height) == 0)
++ mp_msg(MSGT_VO, MSGL_INFO, "[vo_vaapi] Using GLX texture-from-pixmap extension\n");
++ else
++ gl_use_tfp = 0;
++
++ /* Create OpenGL texture */
++ /* XXX: assume GL_ARB_texture_non_power_of_two is available */
++ glEnable(GL_TEXTURE_2D);
++ glGenTextures(1, &gl_texture);
++ mpglBindTexture(GL_TEXTURE_2D, gl_texture);
++ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
++ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
++ if (!gl_use_tfp) {
++ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
++ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
++ glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
++ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0,
++ GL_BGRA, GL_UNSIGNED_BYTE, NULL);
++ }
++ mpglBindTexture(GL_TEXTURE_2D, 0);
++ glDisable(GL_TEXTURE_2D);
++
++ glClearColor(0.0, 0.0, 0.0, 1.0);
++ glClear(GL_COLOR_BUFFER_BIT);
++
++ if (gl_build_font() < 0)
++ return -1;
++ return 0;
++}
++#endif
++
++#if CONFIG_XRENDER
++static XRenderPictFormat *get_xrender_argb32_format(void)
++{
++ static XRenderPictFormat *pictformat = NULL;
++ XRenderPictFormat templ;
++
++ const unsigned long mask =
++ PictFormatType |
++ PictFormatDepth |
++ PictFormatRed |
++ PictFormatRedMask |
++ PictFormatGreen |
++ PictFormatGreenMask |
++ PictFormatBlue |
++ PictFormatBlueMask |
++ PictFormatAlphaMask;
++
++ if (pictformat)
++ return pictformat;
++
++ /* First, look for a 32-bit format which ignores the alpha component */
++ templ.depth = 32;
++ templ.type = PictTypeDirect;
++ templ.direct.red = 16;
++ templ.direct.green = 8;
++ templ.direct.blue = 0;
++ templ.direct.redMask = 0xff;
++ templ.direct.greenMask = 0xff;
++ templ.direct.blueMask = 0xff;
++ templ.direct.alphaMask = 0;
++
++ pictformat = XRenderFindFormat(mDisplay, mask, &templ, 0);
++
++ if (!pictformat) {
++ /* Not all X servers support xRGB32 formats. However, the
++ * XRENDER spec says that they must support an ARGB32 format,
++ * so we can always return that.
++ */
++ pictformat = XRenderFindStandardFormat(mDisplay, PictStandardARGB32);
++ if (!pictformat)
++ mp_msg(MSGT_VO, MSGL_ERR, "XRENDER ARGB32 format not supported\n");
++ }
++ return pictformat;
++}
++
++static int create_xrender_specific(void)
++{
++ XRenderPictFormat *pictformat;
++
++ if (g_output_rect.width == 0 && g_output_rect.height == 0)
++ return 0;
++
++ g_image_pixmap = XCreatePixmap(mDisplay, vo_window, g_output_rect.width,
++ g_output_rect.height, 32);
++ if (!g_image_pixmap) {
++ mp_msg(MSGT_VO, MSGL_ERR, "Could not create video pixmap\n");
++ return -1;
++ }
++
++ pictformat = get_xrender_argb32_format();
++ if (!pictformat)
++ return -1;
++ xr_video_picture = XRenderCreatePicture(mDisplay, g_image_pixmap,
++ pictformat, 0, NULL);
++ if (!xr_video_picture) {
++ mp_msg(MSGT_VO, MSGL_ERR, "Could not create XRENDER backing picture for Pixmap\n");
++ return -1;
++ }
++ return 0;
++}
++
++static void free_xrender_specific(void)
++{
++ if (xr_video_picture) {
++ XRenderFreePicture(mDisplay, xr_video_picture);
++ xr_video_picture = None;
++ }
++
++ if (g_image_pixmap) {
++ XFreePixmap(mDisplay, g_image_pixmap);
++ g_image_pixmap = None;
++ }
++}
++
++static int reset_xrender_specific(void)
++{
++ free_xrender_specific();
++ return create_xrender_specific();
++}
++
++/* XXX: create a Pixmap as large as the display rect */
++static int config_xrender(unsigned int width, unsigned int height)
++{
++ XWindowAttributes wattr;
++ XRenderPictFormat *pictformat;
++
++ XGetWindowAttributes(mDisplay, vo_window, &wattr);
++ pictformat = XRenderFindVisualFormat(mDisplay, wattr.visual);
++ if (!pictformat) {
++ mp_msg(MSGT_VO, MSGL_ERR, "XRENDER does not support Window visual\n");
++ return -1;
++ }
++
++ xr_window_picture = XRenderCreatePicture(mDisplay, vo_window, pictformat,
++ 0, NULL);
++ if (!xr_window_picture) {
++ mp_msg(MSGT_VO, MSGL_ERR, "Could not create XRENDER backing picture for Window\n");
++ return -1;
++ }
++ return reset_xrender_specific();
++}
++#endif
++
++static int config_vaapi(uint32_t width, uint32_t height, uint32_t format)
++{
++ VAConfigAttrib attrib;
++ VAStatus status;
++ int i, j, profile, entrypoint, max_entrypoints, num_surfaces;
++
++ /* Create video surfaces */
++ if (!IMGFMT_IS_VAAPI(format))
++ num_surfaces = MAX_OUTPUT_SURFACES;
++ else {
++ switch (IMGFMT_VAAPI_CODEC(format)) {
++ case IMGFMT_VAAPI_CODEC_MPEG2:
++ num_surfaces = NUM_VIDEO_SURFACES_MPEG2;
++ break;
++ case IMGFMT_VAAPI_CODEC_MPEG4:
++ num_surfaces = NUM_VIDEO_SURFACES_MPEG4;
++ break;
++ case IMGFMT_VAAPI_CODEC_H264:
++ num_surfaces = NUM_VIDEO_SURFACES_H264;
++ break;
++ case IMGFMT_VAAPI_CODEC_VC1:
++ num_surfaces = NUM_VIDEO_SURFACES_VC1;
++ break;
++ default:
++ num_surfaces = 0;
++ break;
++ }
++ if (num_surfaces == 0)
++ return -1;
++ if (!is_direct_mapping())
++ num_surfaces = FFMIN(2 * num_surfaces, MAX_VIDEO_SURFACES);
++ }
++ for (i = 0; i < num_surfaces; i++) {
++ struct vaapi_surface *surface;
++ surface = alloc_vaapi_surface(width, height, VA_RT_FORMAT_YUV420);
++ if (!surface)
++ return -1;
++ }
++ assert(va_num_surfaces == num_surfaces);
++
++#if CONFIG_VAAPI_GLX
++ /* Create GLX surfaces */
++ if (gl_enabled && !gl_use_tfp) {
++ status = vaCreateSurfaceGLX(va_context->display,
++ GL_TEXTURE_2D, gl_texture,
++ &gl_surface);
++ if (!check_status(status, "vaCreateSurfaceGLX()"))
++ return -1;
++ }
++#endif
++
++ /* Create OSD data */
++ va_osd_draw_alpha = NULL;
++ va_osd_image.image_id = VA_INVALID_ID;
++ va_osd_image.buf = VA_INVALID_ID;
++ va_osd_subpicture = VA_INVALID_ID;
++ ensure_osd();
++
++ /* Create EOSD data */
++ va_eosd_draw_alpha = NULL;
++ va_eosd_image.image_id = VA_INVALID_ID;
++ va_eosd_image.buf = VA_INVALID_ID;
++ va_eosd_subpicture = VA_INVALID_ID;
++ for (i = 0; va_eosd_info[i].format; i++) {
++ for (j = 0; j < va_num_subpic_formats; j++)
++ if (va_subpic_formats[j].fourcc == va_eosd_info[i].format)
++ break;
++ if (j < va_num_subpic_formats &&
++ vaCreateImage(va_context->display, &va_subpic_formats[j],
++ width, height, &va_eosd_image) == VA_STATUS_SUCCESS)
++ break;
++ }
++ if (va_eosd_info[i].format &&
++ vaCreateSubpicture(va_context->display, va_eosd_image.image_id,
++ &va_eosd_subpicture) == VA_STATUS_SUCCESS) {
++ va_eosd_draw_alpha = va_eosd_info[i].draw_alpha;
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] Using %s surface for EOSD\n",
++ string_of_VAImageFormat(&va_eosd_image.format));
++ }
++
++ /* Allocate VA images */
++ if (!IMGFMT_IS_VAAPI(format)) {
++ VAImageFormat *image_format = VAImageFormat_from_imgfmt(format);
++ if (!image_format)
++ return -1;
++ for (i = 0; i < va_num_surfaces; i++) {
++ struct vaapi_surface * const s = va_free_surfaces[i];
++ s->is_bound = 0;
++ status = vaDeriveImage(va_context->display, s->id, &s->image);
++ if (status == VA_STATUS_SUCCESS) {
++ /* vaDeriveImage() is supported, check format */
++ if (s->image.format.fourcc != image_format->fourcc) {
++ vaDestroyImage(va_context->display, s->image.image_id);
++ return -1;
++ }
++ if (s->image.width == width && s->image.height == height) {
++ s->is_bound = 1;
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] Using vaDeriveImage()\n");
++ }
++ else {
++ vaDestroyImage(va_context->display, s->image.image_id);
++ status = VA_STATUS_ERROR_OPERATION_FAILED;
++ }
++
++ }
++ if (status != VA_STATUS_SUCCESS) {
++ status = vaCreateImage(va_context->display, image_format,
++ width, height, &s->image);
++ if (!check_status(status, "vaCreateImage()"))
++ return -1;
++ }
++ }
++ return 0;
++ }
++
++ /* Check profile */
++ profile = VAProfile_from_imgfmt(format);
++ if (profile < 0)
++ return -1;
++
++ /* Check entry-point (only VLD for now) */
++ max_entrypoints = vaMaxNumEntrypoints(va_context->display);
++ va_entrypoints = calloc(max_entrypoints, sizeof(*va_entrypoints));
++ if (!va_entrypoints)
++ return -1;
++
++ status = vaQueryConfigEntrypoints(va_context->display, profile,
++ va_entrypoints, &va_num_entrypoints);
++ if (!check_status(status, "vaQueryConfigEntrypoints()"))
++ return -1;
++
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] config_vaapi(%s): %d entrypoints available\n",
++ string_of_VAProfile(profile), va_num_entrypoints);
++ for (i = 0; i < va_num_entrypoints; i++)
++ mp_msg(MSGT_VO, MSGL_DBG2, " %s\n", string_of_VAEntrypoint(va_entrypoints[i]));
++
++ entrypoint = VAEntrypoint_from_imgfmt(format);
++ if (entrypoint != VAEntrypointVLD)
++ return -1;
++
++ /* Check chroma format (only 4:2:0 for now) */
++ attrib.type = VAConfigAttribRTFormat;
++ status = vaGetConfigAttributes(va_context->display, profile, entrypoint, &attrib, 1);
++ if (!check_status(status, "vaGetConfigAttributes()"))
++ return -1;
++ if ((attrib.value & VA_RT_FORMAT_YUV420) == 0)
++ return -1;
++
++ /* Create a configuration for the decode pipeline */
++ status = vaCreateConfig(va_context->display, profile, entrypoint, &attrib, 1, &va_context->config_id);
++ if (!check_status(status, "vaCreateConfig()"))
++ return -1;
++
++ /* Create a context for the decode pipeline */
++ status = vaCreateContext(va_context->display, va_context->config_id,
++ width, height, VA_PROGRESSIVE,
++ va_surface_ids, va_num_surfaces,
++ &va_context->context_id);
++ if (!check_status(status, "vaCreateContext()"))
++ return -1;
++ return 0;
++}
++
++static int config(uint32_t width, uint32_t height,
++ uint32_t display_width, uint32_t display_height,
++ uint32_t flags, char *title, uint32_t format)
++{
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] config(): size %dx%d, display size %dx%d, flags %x, title '%s', format %x (%s)\n",
++ width, height, display_width, display_height, flags, title, format, vo_format_name(format));
++
++ free_video_specific();
++
++ if (config_x11(width, height, display_width, display_height, flags, title) < 0)
++ return -1;
++
++#if CONFIG_GL
++ if (gl_enabled && config_glx(width, height) < 0)
++ return -1;
++#endif
++
++#if CONFIG_XRENDER
++ if (xr_enabled && config_xrender(width, height) < 0)
++ return -1;
++#endif
++
++ if (config_vaapi(width, height, format) < 0)
++ return -1;
++
++ g_is_visible = 0;
++ g_is_paused = 0;
++ g_image_width = width;
++ g_image_height = height;
++ g_image_format = format;
++ resize();
++ return 0;
++}
++
++static int query_format(uint32_t format)
++{
++ const int default_caps = (VFCAP_CSP_SUPPORTED |
++ VFCAP_CSP_SUPPORTED_BY_HW |
++ VFCAP_HWSCALE_UP |
++ VFCAP_HWSCALE_DOWN |
++ VFCAP_OSD |
++ VFCAP_EOSD);
++
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] query_format(): format %x (%s)\n",
++ format, vo_format_name(format));
++
++ switch (format) {
++ case IMGFMT_VAAPI_MPEG2:
++ case IMGFMT_VAAPI_MPEG4:
++ case IMGFMT_VAAPI_H263:
++ case IMGFMT_VAAPI_H264:
++ case IMGFMT_VAAPI_WMV3:
++ case IMGFMT_VAAPI_VC1:
++ return default_caps | VOCAP_NOSLICES;
++ case IMGFMT_NV12:
++ case IMGFMT_YV12:
++ case IMGFMT_I420:
++ case IMGFMT_IYUV:
++ if (VAImageFormat_from_imgfmt(format))
++ return default_caps;
++ break;
++ }
++ return 0;
++}
++
++static inline int get_field_flags(int i)
++{
++ return (g_deint && (g_image_fields & MP_IMGFIELD_INTERLACED) ?
++ (((!!(g_image_fields & MP_IMGFIELD_TOP_FIRST)) ^ i) == 0 ?
++ VA_BOTTOM_FIELD : VA_TOP_FIELD) : VA_FRAME_PICTURE);
++}
++
++static inline int get_colorspace_flags(void)
++{
++ int csp = 0;
++#if USE_VAAPI_COLORSPACE
++ switch (g_colorspace) {
++ case 0:
++ csp = ((g_image_width >= 1280 || g_image_height > 576) ?
++ VA_SRC_BT709 : VA_SRC_BT601);
++ break;
++ case 1:
++ csp = VA_SRC_BT601;
++ break;
++ case 2:
++ csp = VA_SRC_BT709;
++ break;
++ case 3:
++ csp = VA_SRC_SMPTE_240;
++ break;
++ default:
++ assert(0);
++ break;
++ }
++#endif
++ return csp;
++}
++
++static void put_surface_x11(struct vaapi_surface *surface)
++{
++ VAStatus status;
++ int i;
++
++ for (i = 0; i <= !!(g_deint > 1); i++) {
++ const unsigned int flags = (get_field_flags(i) |
++ get_colorspace_flags() |
++ g_scaling);
++ status = vaPutSurface(va_context->display,
++ surface->id,
++ vo_window,
++ 0, 0, g_image_width, g_image_height,
++ g_output_rect.left,
++ g_output_rect.top,
++ g_output_rect.width,
++ g_output_rect.height,
++ NULL, 0,
++ flags);
++ if (!check_status(status, "vaPutSurface()"))
++ return;
++ }
++}
++
++#if CONFIG_GL
++static void put_surface_glx(struct vaapi_surface *surface)
++{
++ VAStatus status;
++ int i;
++
++ if (gl_use_tfp) {
++ for (i = 0; i <= !!(g_deint > 1); i++) {
++ const unsigned int flags = (get_field_flags(i) |
++ get_colorspace_flags() |
++ g_scaling);
++ status = vaPutSurface(va_context->display,
++ surface->id,
++ g_image_pixmap,
++ 0, 0, g_image_width, g_image_height,
++ 0, 0, g_image_width, g_image_height,
++ NULL, 0,
++ flags);
++ if (!check_status(status, "vaPutSurface()"))
++ return;
++ }
++ g_output_surfaces[g_output_surface] = surface;
++ return;
++ }
++
++#if CONFIG_VAAPI_GLX
++ if (gl_binding) {
++#if USE_VAAPI_GLX_BIND
++ for (i = 0; i <= !!(g_deint > 1); i++) {
++ const unsigned int flags = (get_field_flags(i) |
++ get_colorspace_flags() |
++ g_scaling);
++ status = vaAssociateSurfaceGLX(va_context->display,
++ gl_surface,
++ surface->id,
++ flags);
++ if (!check_status(status, "vaAssociateSurfaceGLX()"))
++ return;
++ }
++#else
++ mp_msg(MSGT_VO, MSGL_WARN, "vaAssociateSurfaceGLX() is not implemented\n");
++ gl_binding = 0;
++#endif
++ }
++
++ if (!gl_binding) {
++ for (i = 0; i <= !!(g_deint > 1); i++) {
++ const unsigned int flags = (get_field_flags(i) |
++ get_colorspace_flags() |
++ g_scaling);
++ status = vaCopySurfaceGLX(va_context->display,
++ gl_surface,
++ surface->id,
++ flags);
++
++ if (status == VA_STATUS_ERROR_UNIMPLEMENTED) {
++ mp_msg(MSGT_VO, MSGL_WARN,
++ "[vo_vaapi] vaCopySurfaceGLX() is not implemented\n");
++ gl_binding = 1;
++ }
++ else {
++ if (!check_status(status, "vaCopySurfaceGLX()"))
++ return;
++ }
++ }
++ }
++#endif
++ g_output_surfaces[g_output_surface] = surface;
++}
++
++static int glx_bind_texture(void)
++{
++ glEnable(GL_TEXTURE_2D);
++ mpglBindTexture(GL_TEXTURE_2D, gl_texture);
++
++ if (gl_use_tfp) {
++ x11_trap_errors();
++ mpglXBindTexImage(mDisplay, gl_pixmap, GLX_FRONT_LEFT_EXT, NULL);
++ XSync(mDisplay, False);
++ if (x11_untrap_errors())
++ mp_msg(MSGT_VO, MSGL_WARN, "[vo_vaapi] Update bind_tex_image failed\n");
++ }
++
++#if USE_VAAPI_GLX_BIND
++ if (gl_binding) {
++ VAStatus status;
++ status = vaBeginRenderSurfaceGLX(va_context->display, gl_surface);
++ if (!check_status(status, "vaBeginRenderSurfaceGLX()"))
++ return -1;
++ }
++#endif
++ return 0;
++}
++
++static int glx_unbind_texture(void)
++{
++ if (gl_use_tfp) {
++ x11_trap_errors();
++ mpglXReleaseTexImage(mDisplay, gl_pixmap, GLX_FRONT_LEFT_EXT);
++ if (x11_untrap_errors())
++ mp_msg(MSGT_VO, MSGL_WARN, "[vo_vaapi] Failed to release?\n");
++ }
++
++#if USE_VAAPI_GLX_BIND
++ if (gl_binding) {
++ VAStatus status;
++ status = vaEndRenderSurfaceGLX(va_context->display, gl_surface);
++ if (!check_status(status, "vaEndRenderSurfaceGLX()"))
++ return -1;
++ }
++#endif
++
++ mpglBindTexture(GL_TEXTURE_2D, 0);
++ glDisable(GL_TEXTURE_2D);
++ return 0;
++}
++
++static void render_background(void)
++{
++ /* Original code from Mirco Muller (MacSlow):
++ <http://cgit.freedesktop.org/~macslow/gl-gst-player/> */
++ GLfloat fStartX = 0.0f;
++ GLfloat fStartY = 0.0f;
++ GLfloat fWidth = (GLfloat)vo_dwidth;
++ GLfloat fHeight = (GLfloat)vo_dheight;
++
++ glBegin(GL_QUADS);
++ {
++ /* top third, darker grey to white */
++ glColor3f(0.85f, 0.85f, 0.85f);
++ glVertex3f(fStartX, fStartY, 0.0f);
++ glColor3f(0.85f, 0.85f, 0.85f);
++ glVertex3f(fStartX + fWidth, fStartY, 0.0f);
++ glColor3f(1.0f, 1.0f, 1.0f);
++ glVertex3f(fStartX + fWidth, fStartY + fHeight / 3.0f, 0.0f);
++ glColor3f(1.0f, 1.0f, 1.0f);
++ glVertex3f(fStartX, fStartY + fHeight / 3.0f, 0.0f);
++
++ /* middle third, just plain white */
++ glColor3f(1.0f, 1.0f, 1.0f);
++ glVertex3f(fStartX, fStartY + fHeight / 3.0f, 0.0f);
++ glVertex3f(fStartX + fWidth, fStartY + fHeight / 3.0f, 0.0f);
++ glVertex3f(fStartX + fWidth, fStartY + 2.0f * fHeight / 3.0f, 0.0f);
++ glVertex3f(fStartX, fStartY + 2.0f * fHeight / 3.0f, 0.0f);
++
++ /* bottom third, white to lighter grey */
++ glColor3f(1.0f, 1.0f, 1.0f);
++ glVertex3f(fStartX, fStartY + 2.0f * fHeight / 3.0f, 0.0f);
++ glColor3f(1.0f, 1.0f, 1.0f);
++ glVertex3f(fStartX + fWidth, fStartY + 2.0f * fHeight / 3.0f, 0.0f);
++ glColor3f(0.62f, 0.66f, 0.69f);
++ glVertex3f(fStartX + fWidth, fStartY + fHeight, 0.0f);
++ glColor3f(0.62f, 0.66f, 0.69f);
++ glVertex3f(fStartX, fStartY + fHeight, 0.0f);
++ }
++ glEnd();
++}
++
++static void render_frame(void)
++{
++ struct vo_rect * const r = &g_output_rect;
++
++ if (glx_bind_texture() < 0)
++ return;
++ glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
++ glBegin(GL_QUADS);
++ {
++ glTexCoord2f(0.0f, 0.0f); glVertex2i(r->left, r->top);
++ glTexCoord2f(0.0f, 1.0f); glVertex2i(r->left, r->bottom);
++ glTexCoord2f(1.0f, 1.0f); glVertex2i(r->right, r->bottom);
++ glTexCoord2f(1.0f, 0.0f); glVertex2i(r->right, r->top);
++ }
++ glEnd();
++ if (glx_unbind_texture() < 0)
++ return;
++}
++
++static void render_reflection(void)
++{
++ struct vo_rect * const r = &g_output_rect;
++ const unsigned int rh = g_output_rect.height / 5;
++ GLfloat ry = 1.0f - (GLfloat)rh / (GLfloat)r->height;
++
++ if (glx_bind_texture() < 0)
++ return;
++ glBegin(GL_QUADS);
++ {
++ glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
++ glTexCoord2f(0.0f, 1.0f); glVertex2i(r->left, r->top);
++ glTexCoord2f(1.0f, 1.0f); glVertex2i(r->right, r->top);
++
++ glColor4f(1.0f, 1.0f, 1.0f, 0.0f);
++ glTexCoord2f(1.0f, ry); glVertex2i(r->right, r->top + rh);
++ glTexCoord2f(0.0f, ry); glVertex2i(r->left, r->top + rh);
++ }
++ glEnd();
++ if (glx_unbind_texture() < 0)
++ return;
++}
++
++static void flip_page_glx(void)
++{
++ glClear(GL_COLOR_BUFFER_BIT);
++
++ if (gl_reflect) {
++ render_background();
++
++ glPushMatrix();
++ glRotatef(20.0f, 0.0f, 1.0f, 0.0f);
++ glTranslatef(50.0f, 0.0f, 0.0f);
++ }
++
++ render_frame();
++
++ if (gl_reflect) {
++ glPushMatrix();
++ glTranslatef(0.0, (GLfloat)g_output_rect.height + 5.0f, 0.0f);
++ render_reflection();
++ glPopMatrix();
++ glPopMatrix();
++ }
++
++ if (cpu_stats) {
++ gl_draw_rectangle(0, 0, vo_dwidth, 32, 0x000000ff);
++ glColor3f(1.0f, 1.0f, 1.0f);
++ glRasterPos2i(16, 20);
++ gl_printf("MPlayer: %.1f%% of CPU @ %u MHz", cpu_usage, cpu_frequency);
++ }
++
++ if (gl_finish)
++ mpglFinish();
++ gl_context.swapGlBuffers(&gl_context);
++
++ if (vo_fs) /* avoid flickering borders in fullscreen mode */
++ glClear(GL_COLOR_BUFFER_BIT);
++}
++#endif
++
++#if CONFIG_XRENDER
++static void put_surface_xrender(struct vaapi_surface *surface)
++{
++ VAStatus status;
++ int i;
++
++ for (i = 0; i <= !!(g_deint > 1); i++) {
++ const unsigned int flags = (get_field_flags(i) |
++ get_colorspace_flags() |
++ g_scaling);
++ status = vaPutSurface(va_context->display,
++ surface->id,
++ g_image_pixmap,
++ 0, 0, g_image_width, g_image_height,
++ 0, 0, g_output_rect.width, g_output_rect.height,
++ NULL, 0,
++ flags);
++ if (!check_status(status, "vaPutSurface()"))
++ return;
++ XRenderComposite(mDisplay,
++ PictOpSrc, xr_video_picture, 0, xr_window_picture,
++ 0, 0,
++ 0, 0,
++ g_output_rect.left, g_output_rect.top,
++ g_output_rect.width, g_output_rect.height);
++ }
++}
++#endif
++
++static void put_surface(struct vaapi_surface *surface)
++{
++ if (!surface || surface->id == VA_INVALID_SURFACE)
++ return;
++
++#if CONFIG_GL
++ if (gl_enabled)
++ put_surface_glx(surface);
++ else
++#endif
++#if CONFIG_XRENDER
++ if (xr_enabled)
++ put_surface_xrender(surface);
++ else
++#endif
++ put_surface_x11(surface);
++}
++
++static int draw_slice(uint8_t * image[], int stride[],
++ int w, int h, int x, int y)
++{
++ struct vaapi_surface * const surface = va_free_surfaces[g_output_surface];
++ VAImage * const va_image = &surface->image;
++ VAStatus status;
++ uint8_t *image_data = NULL;
++ uint8_t *dst[3] = { 0, };
++ unsigned int dst_stride[3];
++
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] draw_slice(): location (%d,%d), size %dx%d\n", x, y, w, h);
++
++ status = vaMapBuffer(va_context->display, va_image->buf,
++ (void *)&image_data);
++ if (!check_status(status, "vaMapBuffer()"))
++ return VO_FALSE;
++
++ dst_stride[0] = va_image->pitches[0];
++ dst[0] = image_data + va_image->offsets[0] + y * dst_stride[0] + x;
++
++ memcpy_pic(dst[0], image[0], w, h, dst_stride[0], stride[0]);
++
++ x /= 2;
++ y /= 2;
++ w /= 2;
++ h /= 2;
++
++ if (g_image_format == IMGFMT_YV12) {
++ /* MPlayer's YV12 is actually I420, so swap U/V components */
++ dst_stride[1] = va_image->pitches[2];
++ dst[1] = image_data + va_image->offsets[2] + y * dst_stride[1] + x;
++ dst_stride[2] = va_image->pitches[1];
++ dst[2] = image_data + va_image->offsets[1] + y * dst_stride[2] + x;
++ }
++ else {
++ if (image[1]) {
++ dst_stride[1] = va_image->pitches[1];
++ dst[1] = image_data + va_image->offsets[1] + y * dst_stride[1] + x;
++ }
++ if (image[2]) {
++ dst_stride[2] = va_image->pitches[2];
++ dst[2] = image_data + va_image->offsets[2] + y * dst_stride[2] + x;
++ }
++ }
++
++ if (image[1]) /* RGBA only has a single plane */
++ memcpy_pic(dst[1], image[1], w, h, dst_stride[1], stride[1]);
++
++ if (image[2]) /* NV12 only has two planes */
++ memcpy_pic(dst[2], image[2], w, h, dst_stride[2], stride[2]);
++
++ status = vaUnmapBuffer(va_context->display, surface->image.buf);
++ if (!check_status(status, "vaUnmapBuffer()"))
++ return VO_FALSE;
++
++ return VO_TRUE;
++}
++
++static int draw_frame(uint8_t * src[])
++{
++ mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_X11_DrawFrameCalled);
++
++ return -1;
++}
++
++static void draw_osd(void)
++{
++ VAStatus status;
++ const int osd_width = va_osd_image.width;
++ const int osd_height = va_osd_image.height;
++
++ ensure_osd();
++ if (va_osd_image.image_id == VA_INVALID_ID)
++ return;
++
++ if (!va_osd_draw_alpha)
++ return;
++
++ if (!vo_update_osd(osd_width, osd_height))
++ return;
++
++ if (!vo_osd_check_range_update(0, 0, osd_width, osd_height)) {
++ disable_osd();
++ return;
++ }
++
++ status = vaMapBuffer(va_context->display, va_osd_image.buf,
++ (void *)&va_osd_image_data);
++ if (!check_status(status, "vaMapBuffer()"))
++ return;
++
++ memset(va_osd_image_data, 0, va_osd_image.data_size);
++
++ vo_draw_text(osd_width, osd_height, va_osd_draw_alpha);
++
++ status = vaUnmapBuffer(va_context->display, va_osd_image.buf);
++ if (!check_status(status, "vaUnmapBuffer()"))
++ return;
++ va_osd_image_data = NULL;
++
++ enable_osd();
++}
++
++static void draw_eosd(struct mp_eosd_image_list *imgs)
++{
++ struct mp_eosd_image *img = eosd_image_first(imgs);
++ struct mp_eosd_image *i;
++ VAStatus status;
++
++ if (!va_eosd_draw_alpha)
++ return;
++
++ // Nothing changed, no need to redraw
++ if (imgs->changed == 0)
++ return;
++
++ // There's nothing to render!
++ if (!img) {
++ disable_eosd();
++ return;
++ }
++
++ if (imgs->changed == 1)
++ goto eosd_skip_upload;
++
++ status = vaMapBuffer(va_context->display, va_eosd_image.buf,
++ (void *)&va_eosd_image_data);
++ if (!check_status(status, "vaMapBuffer()"))
++ return;
++
++ memset(va_eosd_image_data, 0, va_eosd_image.data_size);
++
++ for (i = img; i; i = i->next)
++ va_eosd_draw_alpha(i->bitmap, i->w, i->h, i->stride,
++ i->dst_x, i->dst_y, i->color);
++
++ status = vaUnmapBuffer(va_context->display, va_eosd_image.buf);
++ if (!check_status(status, "vaUnmapBuffer()"))
++ return;
++ va_eosd_image_data = NULL;
++
++eosd_skip_upload:
++ enable_eosd();
++}
++
++static void flip_page(void)
++{
++ struct vaapi_surface *surface;
++
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] flip_page()\n");
++
++ surface = g_output_surfaces[g_output_surface];
++ if (!surface)
++ return;
++
++ put_surface(surface);
++ g_output_surface = (g_output_surface + 1) % MAX_OUTPUT_SURFACES;
++ g_is_visible = 1;
++
++#if CONFIG_GL
++ if (gl_enabled)
++ flip_page_glx();
++#endif
++}
++
++static struct vaapi_surface *get_surface(mp_image_t *mpi)
++{
++ struct vaapi_surface *surface;
++
++ if (mpi->type == MP_IMGTYPE_NUMBERED && is_direct_mapping()) {
++ assert(mpi->number < va_num_surfaces);
++ surface = va_free_surfaces[mpi->number];
++ return surface;
++ }
++
++ /* Push current surface to a free slot */
++ if (mpi->priv) {
++ assert(!va_free_surfaces[va_free_surfaces_tail_index]);
++ va_free_surfaces[va_free_surfaces_tail_index] = mpi->priv;
++ va_free_surfaces_tail_index = (va_free_surfaces_tail_index + 1) % va_num_surfaces;
++ }
++
++ /* Pop the least recently used free surface */
++ assert(va_free_surfaces[va_free_surfaces_head_index]);
++ surface = va_free_surfaces[va_free_surfaces_head_index];
++ va_free_surfaces[va_free_surfaces_head_index] = NULL;
++ va_free_surfaces_head_index = (va_free_surfaces_head_index + 1) % va_num_surfaces;
++ return surface;
++}
++
++static uint32_t get_image(mp_image_t *mpi)
++{
++ struct vaapi_surface *surface;
++
++ if (mpi->type != MP_IMGTYPE_NUMBERED)
++ return VO_FALSE;
++
++ if (!IMGFMT_IS_VAAPI(g_image_format))
++ return VO_FALSE;
++
++ surface = get_surface(mpi);
++ if (!surface)
++ return VO_FALSE;
++
++ mpi->flags |= MP_IMGFLAG_DIRECT;
++ mpi->stride[0] = mpi->stride[1] = mpi->stride[2] = mpi->stride[3] = 0;
++ mpi->planes[0] = mpi->planes[1] = mpi->planes[2] = mpi->planes[3] = NULL;
++ mpi->planes[0] = (char *)surface;
++ mpi->planes[3] = (char *)(uintptr_t)surface->id;
++ mpi->num_planes = 1;
++ mpi->priv = surface;
++
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] get_image(): surface 0x%08x\n", surface->id);
++
++ return VO_TRUE;
++}
++
++static int put_image(mp_image_t *mpi, struct vaapi_surface *surface)
++{
++ VAStatus status;
++
++ if ((mpi->flags & (MP_IMGFLAG_PLANAR|MP_IMGFLAG_YUV)) != (MP_IMGFLAG_PLANAR|MP_IMGFLAG_YUV))
++ return VO_FALSE;
++
++ if (!(mpi->flags & MP_IMGFLAG_DRAW_CALLBACK)) {
++ if (!draw_slice(mpi->planes, mpi->stride, mpi->w, mpi->h, 0, 0))
++ return VO_FALSE;
++ }
++
++ if (!surface->is_bound) {
++ status = vaPutImage2(va_context->display,
++ surface->id,
++ surface->image.image_id,
++ mpi->x, mpi->y, mpi->w, mpi->h,
++ mpi->x, mpi->y, mpi->w, mpi->h);
++ if (!check_status(status, "vaPutImage()"))
++ return VO_FALSE;
++ }
++
++ return VO_TRUE;
++}
++
++static uint32_t draw_image(mp_image_t *mpi)
++{
++ struct vaapi_surface *surface = (struct vaapi_surface *)mpi->priv;
++
++ g_image_fields = mpi->fields;
++
++ if (!IMGFMT_IS_VAAPI(mpi->imgfmt)) {
++ /* XXX: no direct rendering in non-accelerated mode */
++ surface = va_free_surfaces[g_output_surface];
++ if (!put_image(mpi, surface))
++ return VO_FALSE;
++ }
++
++ mp_msg(MSGT_VO, MSGL_DBG2, "[vo_vaapi] draw_image(): surface 0x%08x\n", surface->id);
++
++ g_output_surfaces[g_output_surface] = surface;
++
++ if (cpu_stats) {
++ static uint64_t ticks;
++ if ((ticks++ % 30) == 0) {
++ cpu_frequency = get_cpu_frequency();
++ cpu_usage = get_cpu_usage(CPU_USAGE_QUANTUM);
++ }
++ }
++ return VO_TRUE;
++}
++
++static void check_events(void)
++{
++ int events = vo_x11_check_events(mDisplay);
++
++ if (events & VO_EVENT_RESIZE)
++ resize();
++
++ if ((events & (VO_EVENT_EXPOSE|VO_EVENT_RESIZE)) && g_is_paused) {
++ /* Redraw the last visible buffer */
++ if (g_is_visible) {
++ struct vaapi_surface *surface = g_output_surfaces[g_output_surface];
++ if (surface)
++ put_surface(surface);
++ }
++ }
++}
++
++static VADisplayAttribute *get_display_attribute(const char *name)
++{
++ VADisplayAttribute *attr;
++ if (!strcasecmp(name, "brightness"))
++ attr = &va_equalizer.brightness;
++ else if (!strcasecmp(name, "contrast"))
++ attr = &va_equalizer.contrast;
++ else if (!strcasecmp(name, "saturation"))
++ attr = &va_equalizer.saturation;
++ else if (!strcasecmp(name, "hue"))
++ attr = &va_equalizer.hue;
++ else
++ attr = NULL;
++ return attr;
++}
++
++static int get_equalizer(const char *name, int *value)
++{
++ VADisplayAttribute * const attr = get_display_attribute(name);
++ int r;
++
++ if (!attr || !(attr->flags & VA_DISPLAY_ATTRIB_GETTABLE))
++ return VO_NOTIMPL;
++
++ /* normalize to -100 .. 100 range */
++ r = attr->max_value - attr->min_value;
++ if (r == 0)
++ return VO_NOTIMPL;
++ *value = ((attr->value - attr->min_value) * 200) / r - 100;
++ return VO_TRUE;
++}
++
++static int set_equalizer(const char *name, int value)
++{
++ VADisplayAttribute * const attr = get_display_attribute(name);
++ VAStatus status;
++ int r;
++
++ if (!attr || !(attr->flags & VA_DISPLAY_ATTRIB_SETTABLE))
++ return VO_NOTIMPL;
++
++ /* normalize to attribute value range */
++ r = attr->max_value - attr->min_value;
++ if (r == 0)
++ return VO_NOTIMPL;
++ attr->value = ((value + 100) * r) / 200 + attr->min_value;
++
++ status = vaSetDisplayAttributes(va_context->display, attr, 1);
++ if (!check_status(status, "vaSetDisplayAttributes()"))
++ return VO_FALSE;
++ return VO_TRUE;
++}
++
++static int control(uint32_t request, void *data)
++{
++ switch (request) {
++ case VOCTRL_GET_DEINTERLACE:
++ *(int*)data = g_deint;
++ return VO_TRUE;
++ case VOCTRL_SET_DEINTERLACE:
++ g_deint = *(int*)data;
++ if (g_deint)
++ g_deint = g_deint_type;
++ return VO_TRUE;
++ case VOCTRL_PAUSE:
++ return (g_is_paused = 1);
++ case VOCTRL_RESUME:
++ return (g_is_paused = 0);
++ case VOCTRL_QUERY_FORMAT:
++ return query_format(*((uint32_t *)data));
++ case VOCTRL_GET_IMAGE:
++ return get_image(data);
++ case VOCTRL_DRAW_IMAGE:
++ return draw_image(data);
++ case VOCTRL_GUISUPPORT:
++ return VO_TRUE;
++ case VOCTRL_BORDER:
++ vo_x11_border();
++ resize();
++ return VO_TRUE;
++ case VOCTRL_FULLSCREEN:
++ vo_x11_fullscreen();
++ resize();
++ return VO_TRUE;
++ case VOCTRL_SET_EQUALIZER: {
++ vf_equalizer_t *eq = data;
++ if (g_image_format == IMGFMT_BGRA)
++ return VO_NOTIMPL;
++
++ return set_equalizer(eq->item, eq->value);
++ }
++ case VOCTRL_GET_EQUALIZER: {
++ vf_equalizer_t *eq = data;
++ return get_equalizer(eq->item, &eq->value);
++ }
++ case VOCTRL_ONTOP:
++ vo_x11_ontop();
++ return VO_TRUE;
++ case VOCTRL_UPDATE_SCREENINFO:
++ update_xinerama_info();
++ return VO_TRUE;
++ case VOCTRL_GET_PANSCAN:
++ return VO_TRUE;
++ case VOCTRL_SET_PANSCAN:
++ resize();
++ return VO_TRUE;
++ case VOCTRL_GET_HWACCEL_CONTEXT:
++ *((void **)data) = va_context;
++ return VO_TRUE;
++ case VOCTRL_DRAW_EOSD:
++ if (!data)
++ return VO_FALSE;
++ draw_eosd(data);
++ return VO_TRUE;
++ case VOCTRL_GET_EOSD_RES: {
++ struct mp_eosd_settings *r = data;
++ r->mt = r->mb = r->ml = r->mr = 0;
++ r->srcw = g_image_width;
++ r->srch = g_image_height;
++ r->w = g_image_width;
++ r->h = g_image_height;
++ return VO_TRUE;
++ }
++ }
++ return VO_NOTIMPL;
++}
+diff -Naur mplayer-1.0_rc4_p20120109/Makefile mplayer-1.0_rc4_p20120109-new/Makefile
+--- mplayer-1.0_rc4_p20120109/Makefile 2012-01-09 14:46:51.000000000 +0100
++++ mplayer-1.0_rc4_p20120109-new/Makefile 2012-01-16 15:51:41.000000000 +0100
+@@ -599,6 +599,7 @@
+ SRCS_MPLAYER-$(TGA) += libvo/vo_tga.c
+ SRCS_MPLAYER-$(V4L2) += libvo/vo_v4l2.c
+ SRCS_MPLAYER-$(V4L2) += libao2/ao_v4l2.c
++SRCS_MPLAYER-$(VAAPI) += libvo/vo_vaapi.c
+ SRCS_MPLAYER-$(VDPAU) += libvo/vo_vdpau.c
+ SRCS_MPLAYER-$(VESA) += libvo/gtf.c libvo/vo_vesa.c libvo/vesa_lvo.c
+ SRCS_MPLAYER-$(VIDIX) += libvo/vo_cvidix.c \
+@@ -652,6 +653,7 @@
+ libao2/audio_out.c \
+ libvo/aspect.c \
+ libvo/geometry.c \
++ libvo/stats.c \
+ libvo/video_out.c \
+ libvo/vo_mpegpes.c \
+ libvo/vo_null.c \
diff --git a/media-sound/mplayer/files/ffmpeg.patch b/media-sound/mplayer/files/ffmpeg.patch
new file mode 100644
index 0000000..e438ead
--- /dev/null
+++ b/media-sound/mplayer/files/ffmpeg.patch
@@ -0,0 +1,17 @@
+Some guards so that it can still build with ffmpeg 0.10
+
+Index: mplayer-1.0_rc4_p20120213/fmt-conversion.c
+===================================================================
+--- mplayer-1.0_rc4_p20120213.orig/fmt-conversion.c
++++ mplayer-1.0_rc4_p20120213/fmt-conversion.c
+@@ -65,8 +65,10 @@ static const struct {
+ {IMGFMT_RGBA, PIX_FMT_RGB0},
+ {IMGFMT_RGB64LE, PIX_FMT_RGBA64LE},
+ {IMGFMT_RGB64BE, PIX_FMT_RGBA64BE},
++#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 35, 101)
+ {IMGFMT_444A, PIX_FMT_YUVA444P},
+ #endif
++#endif
+ #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 20, 1)
+ {IMGFMT_GBR24P, PIX_FMT_GBRP},
+ #endif
diff --git a/media-sound/mplayer/files/ffmpeg2.patch b/media-sound/mplayer/files/ffmpeg2.patch
new file mode 100644
index 0000000..0f26812
--- /dev/null
+++ b/media-sound/mplayer/files/ffmpeg2.patch
@@ -0,0 +1,14 @@
+Index: mplayer-1.0_rc4_p20120405/libmpdemux/mp_taglists.c
+===================================================================
+--- mplayer-1.0_rc4_p20120405.orig/libmpdemux/mp_taglists.c
++++ mplayer-1.0_rc4_p20120405/libmpdemux/mp_taglists.c
+@@ -125,7 +125,9 @@ static const struct AVCodecTag mp_bmp_ta
+ { CODEC_ID_BMV_VIDEO, MKTAG('B', 'M', 'V', 'V')},
+ { CODEC_ID_C93, MKTAG('C', '9', '3', 'V')},
+ { CODEC_ID_CDGRAPHICS, MKTAG('C', 'D', 'G', 'R')},
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54,1,0)
+ { CODEC_ID_CDXL, MKTAG('C', 'D', 'X', 'L')},
++#endif
+ { CODEC_ID_CMV, MKTAG('M', 'V', 'I', 'f')},
+ { CODEC_ID_DFA, MKTAG('C', 'D', 'F', 'A')},
+ { CODEC_ID_DNXHD, MKTAG('A', 'V', 'd', 'n')},
diff --git a/media-sound/mplayer/files/mplayer-1.0_rc4-pkg-config.patch b/media-sound/mplayer/files/mplayer-1.0_rc4-pkg-config.patch
new file mode 100644
index 0000000..a93136c
--- /dev/null
+++ b/media-sound/mplayer/files/mplayer-1.0_rc4-pkg-config.patch
@@ -0,0 +1,74 @@
+respect $PKG_CONFIG, and use pkg-config for libdvdnav/libdvdread by
+default rather than the ugly xxx-config scripts
+
+https://bugs.gentoo.org/410189
+
+hassle vapier@gentoo.org if this causes issues
+
+--- configure
++++ configure
+@@ -4042,7 +4042,7 @@ echores "$_apple_ir"
+ fi #if linux
+
+ echocheck "pkg-config"
+-_pkg_config=pkg-config
++_pkg_config=${PKG_CONFIG:-pkg-config}
+ if $($_pkg_config --version > /dev/null 2>&1); then
+ if test "$ld_static"; then
+ _pkg_config="$_pkg_config --static"
+@@ -5740,8 +5740,13 @@ if test "$_dvdread_internal" = auto ; th
+ elif test "$_dvdread" = auto ; then
+ _dvdread=no
+ if test "$_dl" = yes; then
+- _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
+- _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
++ if ! $_pkg_config --exists dvdread ; then
++ _dvdreadcflags=$($_pkgconfig dvdread --cflags)
++ _dvdreadlibs=$($_pkgconfig dvdread --libs)
++ else
++ _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
++ _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
++ fi
+ if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $ld_dl ; then
+ _dvdread=yes
+ extra_cflags="$extra_cflags $_dvdreadcflags"
+@@ -7721,13 +7726,20 @@ if test "$_dvdnav" = auto ; then
+ dvdnav_internal=yes
+ res_comment="internal"
+ else
+- $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
++ if ! $_pkg_config --exists dvdnavmini ; then
++ $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
++ fi
+ fi
+ fi
+ if test "$_dvdnav" = auto ; then
+ _dvdnav=no
+- _dvdnavdir=$($_dvdnavconfig --cflags)
+- _dvdnavlibs=$($_dvdnavconfig --libs)
++ if $_pkg_config --exists dvdnavmini ; then
++ _dvdnavdir=$($_pkg_config --cflags dvdnavmini)
++ _dvdnavlibs=$($_pkg_config --libs dvdnavmini)
++ else
++ _dvdnavdir=$($_dvdnavconfig --cflags)
++ _dvdnavlibs=$($_dvdnavconfig --libs)
++ fi
+ statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $ld_dl $ld_pthread && _dvdnav=yes
+ fi
+ if test "$_dvdnav" = yes ; then
+@@ -7736,8 +7748,13 @@ if test "$_dvdnav" = yes ; then
+ cflags_libdvdnav="-Ilibdvdnav"
+ inputmodules="dvdnav(internal) $inputmodules"
+ else
+- extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
+- extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
++ if $_pkg_config --exists dvdnavmini ; then
++ extra_cflags="$extra_cflags $($_pkg_config --cflags dvdnavmini)"
++ extra_ldflags="$extra_ldflags $($_pkg_config --libs dvdnavmini)"
++ else
++ extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
++ extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
++ fi
+ inputmodules="dvdnav $inputmodules"
+ fi
+ else
diff --git a/media-sound/mplayer/files/mplayer-1.0_rc4_p20110322-gcc46.patch b/media-sound/mplayer/files/mplayer-1.0_rc4_p20110322-gcc46.patch
new file mode 100644
index 0000000..bb7240e
--- /dev/null
+++ b/media-sound/mplayer/files/mplayer-1.0_rc4_p20110322-gcc46.patch
@@ -0,0 +1,22 @@
+https://bugs.gentoo.org/377837
+http://lists-archives.org/mplayer-dev-eng/34349-compiling-mplayer-with-gcc-4-6-broken-audio-decoding.html
+
+--- a/mp3lib/dct64_sse.c
++++ b/mp3lib/dct64_sse.c
+@@ -112,7 +112,6 @@ void dct64_sse(short *out0,short *out1,real *c)
+ }
+
+ {
+- real *costab = costab_mmx + 24;
+ int i;
+
+ __asm__(
+@@ -121,7 +120,7 @@ void dct64_sse(short *out0,short *out1,real *c)
+ "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/media-sound/mplayer/files/mplayer-1.0_rc4_p20110322-sami_subtitle_parsing.patch b/media-sound/mplayer/files/mplayer-1.0_rc4_p20110322-sami_subtitle_parsing.patch
new file mode 100644
index 0000000..edecce0
--- /dev/null
+++ b/media-sound/mplayer/files/mplayer-1.0_rc4_p20110322-sami_subtitle_parsing.patch
@@ -0,0 +1,14 @@
+http://bugs.gentoo.org/379297
+http://mplayerhq.hu/pipermail/mplayer-cvslog/2011-May/042075.html
+
+--- sub/subreader.c
++++ sub/subreader.c
+@@ -173,6 +173,8 @@
+ break;
+
+ case 3: /* get all text until '<' appears */
++ if (p - text >= LINE_LEN)
++ sami_add_line(current, text, &p);
+ if (*s == '\0') break;
+ else if (!strncasecmp (s, "<br>", 4)) {
+ sami_add_line(current, text, &p);
diff --git a/media-sound/mplayer/files/mplayer-1.1-codecid.patch b/media-sound/mplayer/files/mplayer-1.1-codecid.patch
new file mode 100644
index 0000000..38a58aa
--- /dev/null
+++ b/media-sound/mplayer/files/mplayer-1.1-codecid.patch
@@ -0,0 +1,19 @@
+r35075 | iive | 2012-08-11 12:42:43 -0400 (Sat, 11 Aug 2012) | 4 lines
+
+Quick Build Fix. FFmpeg CodecID is redefined as AVCodecID.
+It needs the FFmpeg includes in all places that use it.
+
+
+Index: libmpdemux/mp_taglists.h
+===================================================================
+--- libmpdemux/mp_taglists.h (revision 35074)
++++ libmpdemux/mp_taglists.h (revision 35075)
+@@ -20,6 +20,8 @@
+ #define MPLAYER_MP_TAGLISTS_H
+
+ #include <stdint.h>
++#include "libavutil/common.h"
++#include "libavformat/avformat.h"
+
+ enum CodecID mp_tag2codec_id(uint32_t tag, int audio);
+ uint32_t mp_codec_id2tag(enum CodecID codec_id, uint32_t old_tag, int audio);
diff --git a/media-sound/mplayer/files/mplayer-1.1-ffmpeg.patch b/media-sound/mplayer/files/mplayer-1.1-ffmpeg.patch
new file mode 100644
index 0000000..6ec6ef7
--- /dev/null
+++ b/media-sound/mplayer/files/mplayer-1.1-ffmpeg.patch
@@ -0,0 +1,34 @@
+Let it build with ffmpeg 0.10.3.
+
+Index: MPlayer-1.1/fmt-conversion.c
+===================================================================
+--- MPlayer-1.1.orig/fmt-conversion.c
++++ MPlayer-1.1/fmt-conversion.c
+@@ -65,9 +65,13 @@ static const struct {
+ {IMGFMT_RGBA, PIX_FMT_RGB0},
+ {IMGFMT_RGB64LE, PIX_FMT_RGBA64LE},
+ {IMGFMT_RGB64BE, PIX_FMT_RGBA64BE},
++#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 50, 0)
+ {IMGFMT_422A, PIX_FMT_YUVA422P},
++#endif
++#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 35, 101)
+ {IMGFMT_444A, PIX_FMT_YUVA444P},
+ #endif
++#endif
+ #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 20, 1)
+ {IMGFMT_GBR24P, PIX_FMT_GBRP},
+ #endif
+Index: MPlayer-1.1/libmpdemux/mp_taglists.c
+===================================================================
+--- MPlayer-1.1.orig/libmpdemux/mp_taglists.c
++++ MPlayer-1.1/libmpdemux/mp_taglists.c
+@@ -125,7 +125,9 @@ static const struct AVCodecTag mp_bmp_ta
+ { CODEC_ID_BMV_VIDEO, MKTAG('B', 'M', 'V', 'V')},
+ { CODEC_ID_C93, MKTAG('C', '9', '3', 'V')},
+ { CODEC_ID_CDGRAPHICS, MKTAG('C', 'D', 'G', 'R')},
++#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(54,1,0)
+ { CODEC_ID_CDXL, MKTAG('C', 'D', 'X', 'L')},
++#endif
+ { CODEC_ID_CMV, MKTAG('M', 'V', 'I', 'f')},
+ { CODEC_ID_DFA, MKTAG('C', 'D', 'F', 'A')},
+ { CODEC_ID_DNXHD, MKTAG('A', 'V', 'd', 'n')},
diff --git a/media-sound/mplayer/files/prepare_mplayer.sh b/media-sound/mplayer/files/prepare_mplayer.sh
new file mode 100644
index 0000000..05aca67
--- /dev/null
+++ b/media-sound/mplayer/files/prepare_mplayer.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+VERSION=$(date +%Y%m%d)
+PACKAGE="mplayer-1.0_rc4_p${VERSION}"
+DUMP_FFMPEG="$(dirname $0)/dump_ffmpeg.sh"
+
+svn checkout svn://svn.mplayerhq.hu/mplayer/trunk ${PACKAGE}
+
+pushd ${PACKAGE} > /dev/null
+ # ffmpeg is in git now so no svn external anymore
+ rm -rf ffmpeg
+ git clone git://git.videolan.org/ffmpeg.git ffmpeg/
+ sh "$DUMP_FFMPEG"
+ STORE_VERSION=$(LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2)
+ printf "$STORE_VERSION" > snapshot_version
+popd > /dev/null
+
+find "${PACKAGE}" -type d -name '.svn' -prune -print0 | xargs -0 rm -rf
+find "${PACKAGE}" -type d -name '.git' -prune -print0 | xargs -0 rm -rf
+
+tar cJf ${PACKAGE}.tar.xz ${PACKAGE}
+rm -rf ${PACKAGE}/
+
+echo "Tarball: \"${PACKAGE}.tar.xz\""
+
+echo "** all done **"
diff --git a/media-sound/mplayer/metadata.xml b/media-sound/mplayer/metadata.xml
new file mode 100644
index 0000000..0801e26
--- /dev/null
+++ b/media-sound/mplayer/metadata.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>video</herd>
+<maintainer>
+ <email>media-video@gentoo.org</email>
+</maintainer>
+<use>
+ <flag name="3dnowext">Enable 3dnowext cpu instructions</flag>
+ <flag name="amr">Enables Adaptive Multi-Rate format support</flag>
+ <flag name="bl">Blinkenlights video output</flag>
+ <flag name="bluray">Enable playback of Blu-ray filesystems</flag>
+ <flag name="bs2b">Enable Bauer stereophonic-to-binaural headphone filter</flag>
+ <flag name="cdio">Use libcdio for CD support (instead of cdparanoia)</flag>
+ <flag name="cpudetection">Enables runtime CPU detection (useful for bindist, compatibility on other CPUs)</flag>
+ <flag name="custom-cpuopts">Fine-tune custom CPU optimizations (UNSUPPORTED)</flag>
+ <flag name="dirac">Enable Dirac video support (an advanced royalty-free video compression format) via the reference library: dirac.</flag>
+ <flag name="dvdnav">Use forked libdvdnav, navigate menus in GUIs</flag>
+ <flag name="dxr3">Enable DXR3/H+ video output</flag>
+ <flag name="enca">Enables support for charset discovery and conversion</flag>
+ <flag name="faac">Use external faac library for AAC encoding</flag>
+ <flag name="faad">Use external faad library for AAC decoding</flag>
+ <flag name="libmpeg2">Build support for mpeg2 over media-libs/libmpeg2 rather than using ffmpeg.</flag>
+ <flag name="live">Enables live.com streaming media support</flag>
+ <flag name="md5sum">Enables md5sum video output</flag>
+ <flag name="mmxext">Enables mmx2 support</flag>
+ <flag name="mng">MNG input support</flag>
+ <flag name="mpg123">Enable support for mp3 decoding over media-sound/mpg123.</flag>
+ <flag name="network">Enables network streaming support</flag>
+ <flag name="nut">Enables support for the NUT container format</flag>
+ <flag name="osdmenu">Enables support for on-screen display (OSD) menus</flag>
+ <flag name="pnm">Add PNM video output option, to create PPM/PGM/PGMYUV images</flag>
+ <flag name="pvr">Enable Video4Linux2 MPEG PVR</flag>
+ <flag name="radio">Enable V4L2 radio interface and support</flag>
+ <flag name="rar">Enable Unique RAR File Library</flag>
+ <flag name="real">Adds Real audio/video support</flag>
+ <flag name="rtc">Enables usage of the linux real time clock. The alternative is software emulation of rtc</flag>
+ <flag name="rtmp">Enables RTMPDump Streaming Media support</flag>
+ <flag name="schroedinger">Enable Dirac video support (an advanced royalty-free video compression format) via libschroedinger (high-speed implementation in C of the Dirac codec).</flag>
+ <flag name="shm">Enable support for shm</flag>
+ <flag name="ssse3">faster floating point optimization for SSSE3 capable chips (Intel Core 2 and later chips)</flag>
+ <flag name="tga">Enables Targa video output</flag>
+ <flag name="toolame">Enable toolame MPEG-2 encoding</flag>
+ <flag name="tremor">Enable internal support for Vorbis</flag>
+ <flag name="twolame">Enable twolame MPEG-2 encoding</flag>
+ <flag name="vdpau">Enables experimental VDPAU support (requires nVidia video cards) to offload MPEG2/MPEG4/VC1/WMV CPU processing to video card</flag>
+ <flag name="vpx">Enables vp8 codec support using libvpx: Decoding vp8 does not require this to be enabled but libvpx can also be used for decoding; encoding vp8 requires this useflag to be enabled though.</flag>
+ <flag name="vidix">Support for vidix video output</flag>
+ <flag name="xanim">Enables support for xanim based codecs</flag>
+ <flag name="xvmc">Enables X-Video Motion Compensation support</flag>
+ <flag name="zoran">Enables ZR360[56]7/ZR36060 video output</flag>
+</use>
+</pkgmetadata>
diff --git a/media-sound/mplayer/mplayer-1.1-r1.ebuild b/media-sound/mplayer/mplayer-1.1-r1.ebuild
new file mode 100644
index 0000000..1f10ac4
--- /dev/null
+++ b/media-sound/mplayer/mplayer-1.1-r1.ebuild
@@ -0,0 +1,664 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/mplayer-1.1-r1.ebuild,v 1.5 2012/08/22 15:24:11 aballier Exp $
+
+EAPI=4
+
+EGIT_REPO_URI="git://git.videolan.org/ffmpeg.git"
+ESVN_REPO_URI="svn://svn.mplayerhq.hu/mplayer/trunk"
+[[ ${PV} = *9999* ]] && SVN_ECLASS="subversion git-2" || SVN_ECLASS=""
+
+inherit toolchain-funcs eutils flag-o-matic multilib base ${SVN_ECLASS}
+
+IUSE="3dnow 3dnowext +a52 aalib +alsa altivec aqua bidi bindist bl bluray
+bs2b cddb +cdio cdparanoia cpudetection debug dga
+directfb doc +dts +dv dvb +dvd +dvdnav dxr3 +enca +encode faac +faad fbcon
+ftp gif ggi gsm +iconv ipv6 jack joystick jpeg jpeg2k kernel_linux ladspa
++libass libcaca libmpeg2 lirc +live lzo mad md5sum +mmx mmxext mng +mp3 nas
++network nut openal +opengl +osdmenu oss png pnm pulseaudio pvr +quicktime
+radio +rar +real +rtc rtmp samba +shm sdl +speex sse sse2 ssse3
+tga +theora +tremor +truetype +toolame +twolame +unicode v4l vdpau vidix
++vorbis win32codecs +X +x264 xanim xinerama +xscreensaver +xv +xvid xvmc
+zoran"
+
+VIDEO_CARDS="s3virge mga tdfx"
+for x in ${VIDEO_CARDS}; do
+ IUSE+=" video_cards_${x}"
+done
+
+FONT_URI="
+ mirror://mplayer/releases/fonts/font-arial-iso-8859-1.tar.bz2
+ mirror://mplayer/releases/fonts/font-arial-iso-8859-2.tar.bz2
+ mirror://mplayer/releases/fonts/font-arial-cp1250.tar.bz2
+"
+if [[ ${PV} == *9999* ]]; then
+ RELEASE_URI=""
+elif [ "${PV%_rc*}" = "${PV}" ]; then
+ MY_P="MPlayer-${PV}"
+ S="${WORKDIR}/${MY_P}"
+ RELEASE_URI="mirror://mplayer/releases/${MY_P}.tar.xz"
+else
+ RELEASE_URI="mirror://gentoo/${P}.tar.xz"
+fi
+SRC_URI="${RELEASE_URI}
+ !truetype? ( ${FONT_URI} )"
+
+DESCRIPTION="Media Player for Linux"
+HOMEPAGE="http://www.mplayerhq.hu/"
+
+FONT_RDEPS="
+ virtual/ttf-fonts
+ media-libs/fontconfig
+ >=media-libs/freetype-2.2.1:2
+"
+X_RDEPS="
+ x11-libs/libXext
+ x11-libs/libXxf86vm
+"
+# Rar: althrought -gpl version is nice, it cant do most functions normal rars can
+# nemesi? ( net-libs/libnemesi )
+RDEPEND+="
+ sys-libs/ncurses
+ app-arch/bzip2
+ sys-libs/zlib
+ >=media-video/ffmpeg-0.10.3
+ !bindist? (
+ x86? (
+ win32codecs? ( media-libs/win32codecs )
+ )
+ )
+ a52? ( media-libs/a52dec )
+ aalib? ( media-libs/aalib )
+ alsa? ( media-libs/alsa-lib )
+ bidi? ( dev-libs/fribidi )
+ bluray? ( >=media-libs/libbluray-0.2.1 )
+ bs2b? ( media-libs/libbs2b )
+ cdio? ( dev-libs/libcdio )
+ cdparanoia? ( !cdio? ( media-sound/cdparanoia ) )
+ dga? ( x11-libs/libXxf86dga )
+ directfb? ( dev-libs/DirectFB )
+ dts? ( media-libs/libdca )
+ dv? ( media-libs/libdv )
+ dvb? ( virtual/linuxtv-dvb-headers )
+ dvd? ( >=media-libs/libdvdread-4.1.3 )
+ dvdnav? ( >=media-libs/libdvdnav-4.1.3 )
+ encode? (
+ !twolame? ( toolame? ( media-sound/toolame ) )
+ twolame? ( media-sound/twolame )
+ faac? ( media-libs/faac )
+ mp3? ( media-sound/lame )
+ x264? ( >=media-libs/x264-0.0.20100423 )
+ xvid? ( media-libs/xvid )
+ )
+ enca? ( app-i18n/enca )
+ faad? ( media-libs/faad2 )
+ ggi? ( media-libs/libggi media-libs/libggiwmh )
+ gif? ( media-libs/giflib )
+ gsm? ( media-sound/gsm )
+ iconv? ( virtual/libiconv )
+ jack? ( media-sound/jack-audio-connection-kit )
+ jpeg? ( virtual/jpeg )
+ jpeg2k? ( media-libs/openjpeg )
+ ladspa? ( media-libs/ladspa-sdk )
+ libass? ( >=media-libs/libass-0.9.10[enca?] )
+ libcaca? ( media-libs/libcaca )
+ libmpeg2? ( media-libs/libmpeg2 )
+ lirc? ( app-misc/lirc )
+ live? ( media-plugins/live )
+ lzo? ( >=dev-libs/lzo-2 )
+ mad? ( media-libs/libmad )
+ mng? ( media-libs/libmng )
+ mp3? ( media-sound/mpg123 )
+ nas? ( media-libs/nas )
+ nut? ( >=media-libs/libnut-661 )
+ openal? ( media-libs/openal )
+ opengl? ( virtual/opengl )
+ png? ( media-libs/libpng )
+ pnm? ( media-libs/netpbm )
+ pulseaudio? ( media-sound/pulseaudio )
+ rar? (
+ || (
+ app-arch/unrar
+ app-arch/rar
+ )
+ )
+ rtmp? ( media-video/rtmpdump )
+ samba? ( net-fs/samba )
+ sdl? ( media-libs/libsdl )
+ speex? ( media-libs/speex )
+ theora? ( media-libs/libtheora[encode?] )
+ truetype? ( ${FONT_RDEPS} )
+ vdpau? ( x11-libs/libvdpau )
+ vorbis? ( media-libs/libvorbis )
+ X? ( ${X_RDEPS} )
+ xanim? ( media-video/xanim )
+ xinerama? ( x11-libs/libXinerama )
+ xscreensaver? ( x11-libs/libXScrnSaver )
+ xv? ( x11-libs/libXv )
+ xvmc? ( x11-libs/libXvMC )
+"
+
+X_DEPS="
+ x11-proto/videoproto
+ x11-proto/xf86vidmodeproto
+"
+ASM_DEP="dev-lang/yasm"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ dga? ( x11-proto/xf86dgaproto )
+ dxr3? ( media-video/em8300-libraries )
+ X? ( ${X_DEPS} )
+ xinerama? ( x11-proto/xineramaproto )
+ xscreensaver? ( x11-proto/scrnsaverproto )
+ amd64? ( ${ASM_DEP} )
+ doc? (
+ dev-libs/libxslt app-text/docbook-xml-dtd
+ app-text/docbook-xsl-stylesheets
+ )
+ x86? ( ${ASM_DEP} )
+ x86-fbsd? ( ${ASM_DEP} )
+"
+
+SLOT="0"
+LICENSE="GPL-2"
+if [[ ${PV} != *9999* ]]; then
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+else
+ KEYWORDS=""
+fi
+
+# faac codecs are nonfree, win32codecs are nonfree
+# libcdio support: prefer libcdio over cdparanoia and don't check for cddb w/cdio
+# dvd navigation requires dvd read support
+# ass and freetype font require iconv and ass requires freetype fonts
+# unicode transformations are usefull only with iconv
+# libvorbis require external tremor to work
+# radio requires oss or alsa backend
+# xvmc requires xvideo support
+REQUIRED_USE="bindist? ( !faac !win32codecs )
+ dvdnav? ( dvd )
+ libass? ( truetype )
+ truetype? ( iconv )
+ dxr3? ( X )
+ ggi? ( X )
+ xinerama? ( X )
+ dga? ( X )
+ opengl? ( || ( X aqua ) )
+ osdmenu? ( || ( X aqua ) )
+ vdpau? ( X )
+ vidix? ( X )
+ xscreensaver? ( X )
+ xv? ( X )
+ xvmc? ( xv )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.0_rc4-pkg-config.patch"
+ "${FILESDIR}/${P}-ffmpeg.patch"
+ "${FILESDIR}/${P}-codecid.patch"
+)
+
+pkg_setup() {
+ if [[ ${PV} == *9999* ]]; then
+ elog
+ elog "This is a live ebuild which installs the latest from upstream's"
+ elog "subversion repository, and is unsupported by Gentoo."
+ elog "Everything but bugs in the ebuild itself will be ignored."
+ elog
+ fi
+
+ if use cpudetection; then
+ ewarn
+ ewarn "You've enabled the cpudetection flag. This feature is"
+ ewarn "included mainly for people who want to use the same"
+ ewarn "binary on another system with a different CPU architecture."
+ ewarn "MPlayer will already detect your CPU settings by default at"
+ ewarn "buildtime; this flag is used for runtime detection."
+ ewarn "You won't need this turned on if you are only building"
+ ewarn "mplayer for this system. Also, if your compile fails, try"
+ ewarn "disabling this use flag."
+ fi
+}
+
+src_unpack() {
+ if [[ ${PV} = *9999* ]]; then
+ subversion_src_unpack
+ cd "${WORKDIR}"
+ rm -rf "${WORKDIR}/${P}/ffmpeg/"
+ ( S="${WORKDIR}/${P}/ffmpeg/" git-2_src_unpack )
+ else
+ unpack ${A}
+ fi
+
+ if [[ ${PV} = *9999* ]] || [[ "${PV%_rc*}" = "${PV}" ]]; then
+ cd "${S}"
+ cp "${FILESDIR}/dump_ffmpeg.sh" . || die
+ chmod +x dump_ffmpeg.sh
+ ./dump_ffmpeg.sh || die
+ fi
+
+ if ! use truetype; then
+ unpack font-arial-iso-8859-1.tar.bz2 \
+ font-arial-iso-8859-2.tar.bz2 \
+ font-arial-cp1250.tar.bz2
+ fi
+}
+
+src_prepare() {
+ local svf=snapshot_version
+ if [[ ${PV} = *9999* ]]; then
+ # Set SVN version manually
+ subversion_wc_info
+ printf "${ESVN_WC_REVISION}" > $svf
+ fi
+ if [ ! -f VERSION ] ; then
+ [ -f "$svf" ] || die "Missing ${svf}. Did you generate your snapshot with prepare_mplayer.sh?"
+ local sv=$(<$svf)
+ printf "SVN-r${sv} (Gentoo)" > VERSION
+ fi
+
+ # fix path to bash executable in configure scripts
+ sed -i -e "1c\#!${EPREFIX}/bin/bash" configure version.sh || die
+
+ base_src_prepare
+}
+
+src_configure() {
+ local myconf=""
+ local uses i
+
+ # set LINGUAS
+ [[ -n $LINGUAS ]] && LINGUAS="${LINGUAS/da/dk}"
+
+ # mplayer ebuild uses "use foo || --disable-foo" to forcibly disable
+ # compilation in almost every situation. The reason for this is
+ # because if --enable is used, it will force the build of that option,
+ # regardless of whether the dependency is available or not.
+
+ ###################
+ #Optional features#
+ ###################
+ # disable svga since we don't want it
+ # disable arts since we don't have kde3
+ # always disable internal ass
+ myconf+="
+ --disable-svga --disable-svgalib_helper
+ --disable-ass-internal
+ --disable-arts
+ --disable-kai
+ $(use_enable network networking)
+ $(use_enable joystick)
+ "
+ uses="bl bluray enca ftp rtc" # nemesi <- not working with in-tree ebuild
+ myconf+=" --disable-nemesi" # nemesi automagic disable
+ for i in ${uses}; do
+ use ${i} || myconf+=" --disable-${i}"
+ done
+ use bidi || myconf+=" --disable-fribidi"
+ use ipv6 || myconf+=" --disable-inet6"
+ use libass || myconf+=" --disable-ass"
+ use nut || myconf+=" --disable-libnut"
+ use rar || myconf+=" --disable-unrarexec"
+ use samba || myconf+=" --disable-smb"
+ use lirc || myconf+=" --disable-lirc --disable-lircc --disable-apple-ir"
+
+ # libcdio support: prefer libcdio over cdparanoia
+ # don't check for cddb w/cdio
+ if use cdio; then
+ myconf+=" --disable-cdparanoia"
+ else
+ myconf+=" --disable-libcdio"
+ use cdparanoia || myconf+=" --disable-cdparanoia"
+ use cddb || myconf+=" --disable-cddb"
+ fi
+
+ ################################
+ # DVD read, navigation support #
+ ################################
+ #
+ # dvdread - accessing a DVD
+ # dvdnav - navigation of menus
+ #
+ # use external libdvdcss, dvdread and dvdnav
+ myconf+=" --disable-dvdread-internal --disable-libdvdcss-internal"
+ use dvd || myconf+=" --disable-dvdread"
+ use dvdnav || myconf+=" --disable-dvdnav"
+
+ #############
+ # Subtitles #
+ #############
+ #
+ # SRT/ASS/SSA (subtitles) requires freetype support
+ # freetype support requires iconv
+ # iconv optionally can use unicode
+ use truetype || myconf+=" --disable-freetype"
+ use iconv || myconf+=" --disable-iconv --charset=noconv"
+ use iconv && use unicode && myconf+=" --charset=UTF-8"
+
+ #####################################
+ # DVB / Video4Linux / Radio support #
+ #####################################
+ myconf+=" --disable-tv-bsdbt848"
+ # broken upstream, won't work with recent kernels
+ myconf+=" --disable-ivtv"
+ # gone since linux-headers-2.6.38
+ myconf+=" --disable-tv-v4l1"
+ if { use dvb || use v4l || use pvr || use radio; }; then
+ use dvb || myconf+=" --disable-dvb"
+ use pvr || myconf+=" --disable-pvr"
+ use v4l || myconf+=" --disable-tv-v4l2"
+ if use radio && { use dvb || use v4l; }; then
+ myconf+="
+ --enable-radio
+ $(use_enable encode radio-capture)
+ "
+ else
+ myconf+="
+ --disable-radio-v4l2
+ --disable-radio-bsdbt848
+ "
+ fi
+ else
+ myconf+="
+ --disable-tv
+ --disable-tv-v4l2
+ --disable-radio
+ --disable-radio-v4l2
+ --disable-radio-bsdbt848
+ --disable-dvb
+ --disable-v4l2
+ --disable-pvr"
+ fi
+
+ ##########
+ # Codecs #
+ ##########
+ myconf+=" --disable-musepack" # Use internal musepack codecs for SV7 and SV8 support
+ myconf+=" --disable-libmpeg2-internal" # always use system media-libs/libmpeg2
+ use dts || myconf+=" --disable-libdca"
+ # Disable internal mp3lib, bug #384849
+ # Samuli Suominen: Looks like MPlayer in Portage is using internal mp3lib by
+ # default, where as mpg123 upstream has incorporated all the optimizations
+ # from mplayer's mp3lib in libmpg123 and more.
+ # It makes very little sense to use the internal copy as default anymore.
+ myconf+=" --disable-mp3lib"
+ if ! use mp3; then
+ myconf+="
+ --disable-mp3lame
+ --disable-mpg123
+ "
+ fi
+ uses="a52 bs2b dv gsm lzo rtmp"
+ for i in ${uses}; do
+ use ${i} || myconf+=" --disable-lib${i}"
+ done
+
+ uses="faad gif jpeg libmpeg2 live mad mng png pnm speex tga theora xanim"
+ for i in ${uses}; do
+ use ${i} || myconf+=" --disable-${i}"
+ done
+ use jpeg2k || myconf+=" --disable-libopenjpeg"
+ if use vorbis || use tremor; then
+ use tremor || myconf+=" --disable-tremor-internal"
+ use vorbis || myconf+=" --disable-libvorbis"
+ else
+ myconf+="
+ --disable-tremor-internal
+ --disable-tremor
+ --disable-libvorbis
+ "
+ fi
+ # Encoding
+ uses="faac x264 xvid toolame twolame"
+ if use encode; then
+ for i in ${uses}; do
+ use ${i} || myconf+=" --disable-${i}"
+ done
+ else
+ myconf+=" --disable-mencoder"
+ for i in ${uses}; do
+ myconf+=" --disable-${i}"
+ use ${i} && elog "Useflag \"${i}\" will only be useful for encoding, i.e., with \"encode\" useflag enabled."
+ done
+ fi
+
+ #################
+ # Binary codecs #
+ #################
+ # bug 213836
+ if ! use x86 || ! use win32codecs; then
+ use quicktime || myconf+=" --disable-qtx"
+ fi
+
+ ######################
+ # RealPlayer support #
+ ######################
+ # Realplayer support shows up in four places:
+ # - libavcodec (internal)
+ # - win32codecs
+ # - realcodecs (win32codecs libs)
+ # - realcodecs (realplayer libs)
+
+ # internal
+ use real || myconf+=" --disable-real"
+
+ # Real binary codec support only available on x86, amd64
+ if use real; then
+ use x86 && myconf+=" --codecsdir=/opt/RealPlayer/codecs"
+ use amd64 && myconf+=" --codecsdir=/usr/$(get_libdir)/codecs"
+ fi
+ myconf+=" $(use_enable win32codecs win32dll)"
+
+ ################
+ # Video Output #
+ ################
+ uses="directfb md5sum sdl"
+ for i in ${uses}; do
+ use ${i} || myconf+=" --disable-${i}"
+ done
+ use aalib || myconf+=" --disable-aa"
+ use fbcon || myconf+=" --disable-fbdev"
+ use fbcon && use video_cards_s3virge && myconf+=" --enable-s3fb"
+ use libcaca || myconf+=" --disable-caca"
+ use zoran || myconf+=" --disable-zr"
+
+ if ! use kernel_linux || ! use video_cards_mga; then
+ myconf+=" --disable-mga --disable-xmga"
+ fi
+
+ if use video_cards_tdfx; then
+ myconf+="
+ $(use_enable video_cards_tdfx tdfxvid)
+ $(use_enable fbcon tdfxfb)
+ "
+ else
+ myconf+="
+ --disable-3dfx
+ --disable-tdfxvid
+ --disable-tdfxfb
+ "
+ fi
+
+ # sun card, disable by default, see bug #258729
+ myconf+=" --disable-xvr100"
+
+ ################
+ # Audio Output #
+ ################
+ myconf+=" --disable-esd"
+ uses="alsa jack ladspa nas openal"
+ for i in ${uses}; do
+ use ${i} || myconf+=" --disable-${i}"
+ done
+ use pulseaudio || myconf+=" --disable-pulse"
+ if ! use radio; then
+ use oss || myconf+=" --disable-ossaudio"
+ fi
+
+ ####################
+ # Advanced Options #
+ ####################
+ # Platform specific flags, hardcoded on amd64 (see below)
+ use cpudetection && myconf+=" --enable-runtime-cpudetection"
+
+ uses="3dnow 3dnowext altivec mmx mmxext shm sse sse2 ssse3"
+ for i in ${uses}; do
+ myconf+=" $(use_enable ${i})"
+ done
+
+ use debug && myconf+=" --enable-debug=3"
+
+ if use x86 && gcc-specs-pie; then
+ filter-flags -fPIC -fPIE
+ append-ldflags -nopie
+ fi
+
+ ###########################
+ # X enabled configuration #
+ ###########################
+ myconf+=" --disable-gui"
+ myconf+=" --disable-vesa"
+ uses="dxr3 ggi vdpau xinerama xv"
+ for i in ${uses}; do
+ use ${i} || myconf+=" --disable-${i}"
+ done
+ use dga || myconf+=" --disable-dga1 --disable-dga2"
+ use opengl || myconf+=" --disable-gl"
+ use osdmenu && myconf+=" --enable-menu"
+ use vidix || myconf+=" --disable-vidix --disable-vidix-pcidb"
+ use xscreensaver || myconf+=" --disable-xss"
+ use X || myconf+=" --disable-x11"
+ if use xvmc; then
+ myconf+=" --enable-xvmc --with-xvmclib=XvMCW"
+ else
+ myconf+=" --disable-xvmc"
+ fi
+
+ ############################
+ # OSX (aqua) configuration #
+ ############################
+ if use aqua; then
+ myconf+="
+ --enable-macosx-finder
+ --enable-macosx-bundle
+ "
+ fi
+
+ tc-export PKG_CONFIG
+ ./configure \
+ --cc="$(tc-getCC)" \
+ --host-cc="$(tc-getBUILD_CC)" \
+ --prefix="${EPREFIX}/usr" \
+ --bindir="${EPREFIX}/usr/bin" \
+ --libdir="${EPREFIX}/usr/$(get_libdir)" \
+ --confdir="${EPREFIX}/etc/mplayer" \
+ --datadir="${EPREFIX}/usr/share/mplayer${namesuf}" \
+ --mandir="${EPREFIX}/usr/share/man" \
+ --disable-ffmpeg_a \
+ ${myconf} || die
+}
+
+src_compile() {
+ base_src_compile
+ # Build only user-requested docs if they're available.
+ if use doc ; then
+ # select available languages from $LINGUAS
+ LINGUAS=${LINGUAS/zh/zh_CN}
+ local ALLOWED_LINGUAS="cs de en es fr hu it pl ru zh_CN"
+ local BUILT_DOCS=""
+ for i in ${LINGUAS} ; do
+ has ${i} ${ALLOWED_LINGUAS} && BUILT_DOCS+=" ${i}"
+ done
+ if [[ -z $BUILT_DOCS ]]; then
+ emake -j1 html-chunked
+ else
+ for i in ${BUILT_DOCS}; do
+ emake -j1 html-chunked-${i}
+ done
+ fi
+ fi
+}
+
+src_install() {
+ local i
+
+ emake \
+ DESTDIR="${D}" \
+ INSTALLSTRIP="" \
+ install
+
+ dodoc AUTHORS Changelog Copyright README etc/codecs.conf
+
+ docinto tech/
+ dodoc DOCS/tech/{*.txt,MAINTAINERS,mpsub.sub,playtree,TODO,wishlist}
+ docinto TOOLS/
+ dodoc -r TOOLS
+ if use real; then
+ docinto tech/realcodecs/
+ dodoc DOCS/tech/realcodecs/*
+ fi
+ docinto tech/mirrors/
+ dodoc DOCS/tech/mirrors/*
+
+ if use doc; then
+ docinto html/
+ dohtml -r "${S}"/DOCS/HTML/*
+ fi
+
+ if ! use truetype; then
+ dodir /usr/share/mplayer/fonts
+ # Do this generic, as the mplayer people like to change the structure
+ # of their zips ...
+ for i in $(find "${WORKDIR}/" -type d -name 'font-arial-*'); do
+ cp -pPR "${i}" "${ED}/usr/share/mplayer/fonts"
+ done
+ # Fix the font symlink ...
+ rm -rf "${ED}/usr/share/mplayer/font"
+ dosym fonts/font-arial-14-iso-8859-1 /usr/share/mplayer/font
+ fi
+
+ insinto /etc/mplayer
+ newins "${S}/etc/example.conf" mplayer.conf
+ cat >> "${ED}/etc/mplayer/mplayer.conf" << _EOF_
+# Config options can be section specific, global
+# options should go in the default section
+[default]
+_EOF_
+ doins "${S}/etc/input.conf"
+ if use osdmenu; then
+ doins "${S}/etc/menu.conf"
+ fi
+
+ if use truetype; then
+ cat >> "${ED}/etc/mplayer/mplayer.conf" << _EOF_
+fontconfig=1
+subfont-osd-scale=4
+subfont-text-scale=3
+_EOF_
+ fi
+
+ # bug 256203
+ if use rar; then
+ cat >> "${ED}/etc/mplayer/mplayer.conf" << _EOF_
+unrarexec=${EPREFIX}/usr/bin/unrar
+_EOF_
+ fi
+
+ dosym ../../../etc/mplayer/mplayer.conf /usr/share/mplayer/mplayer.conf
+ newbin "${S}/TOOLS/midentify.sh" midentify
+}
+
+pkg_preinst() {
+ [[ -d ${EROOT}/usr/share/mplayer/Skin/default ]] && \
+ rm -rf "${EROOT}/usr/share/mplayer/Skin/default"
+}
+
+pkg_postrm() {
+ # Cleanup stale symlinks
+ [ -L "${EROOT}/usr/share/mplayer/font" -a \
+ ! -e "${EROOT}/usr/share/mplayer/font" ] && \
+ rm -f "${EROOT}/usr/share/mplayer/font"
+
+ [ -L "${EROOT}/usr/share/mplayer/subfont.ttf" -a \
+ ! -e "${EROOT}/usr/share/mplayer/subfont.ttf" ] && \
+ rm -f "${EROOT}/usr/share/mplayer/subfont.ttf"
+}
diff --git a/media-sound/mplayer/mplayer-1.1-r2.ebuild b/media-sound/mplayer/mplayer-1.1-r2.ebuild
new file mode 100644
index 0000000..db0c7c0
--- /dev/null
+++ b/media-sound/mplayer/mplayer-1.1-r2.ebuild
@@ -0,0 +1,698 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header:
+
+EAPI=4
+
+EGIT_REPO_URI="git://git.videolan.org/ffmpeg.git"
+ESVN_REPO_URI="svn://svn.mplayerhq.hu/mplayer/trunk"
+[[ ${PV} = *9999* ]] && SVN_ECLASS="subversion git-2" || SVN_ECLASS=""
+
+inherit toolchain-funcs eutils flag-o-matic multilib base ${SVN_ECLASS}
+
+IUSE="3dnow 3dnowext +a52 aalib +alsa altivec amr aqua bidi bindist bl bluray
+bs2b cddb +cdio cdparanoia coreavc cpudetection debug dga
+directfb doc +dts +dv dvb +dvd +dvdnav dxr3 +enca +encode faac +faad fbcon
+ftp gif ggi gsm +iconv ipv6 jack joystick jpeg jpeg2k kernel_linux ladspa
++libass libcaca libmpeg2 lirc +live lzo mad md5sum +mmx mmxext mng +mp3 nas
++network nut openal +opengl +osdmenu oss png pnm pulseaudio pvr +quicktime
+radio +rar +real +rtc rtmp samba +shm sdl +speex sse sse2 ssse3 stereoscopic
+tga +theora +tremor +truetype +toolame +twolame +unicode v4l vaapi vdpau vidix
++vorbis win32codecs +X +x264 xanim xinerama +xscreensaver +xv +xvid xvmc
+zoran"
+
+VIDEO_CARDS="s3virge mga tdfx"
+for x in ${VIDEO_CARDS}; do
+ IUSE+=" video_cards_${x}"
+done
+
+FONT_URI="
+ mirror://mplayer/releases/fonts/font-arial-iso-8859-1.tar.bz2
+ mirror://mplayer/releases/fonts/font-arial-iso-8859-2.tar.bz2
+ mirror://mplayer/releases/fonts/font-arial-cp1250.tar.bz2
+"
+if [[ ${PV} == *9999* ]]; then
+ RELEASE_URI=""
+elif [ "${PV%_rc*}" = "${PV}" ]; then
+ MY_P="MPlayer-${PV}"
+ S="${WORKDIR}/${MY_P}"
+ RELEASE_URI="mirror://mplayer/releases/${MY_P}.tar.xz"
+else
+ RELEASE_URI="mirror://gentoo/${P}.tar.xz"
+fi
+SRC_URI="${RELEASE_URI}
+ !truetype? ( ${FONT_URI} )"
+
+DESCRIPTION="Media Player for Linux"
+HOMEPAGE="http://www.mplayerhq.hu/"
+
+FONT_RDEPS="
+ virtual/ttf-fonts
+ media-libs/fontconfig
+ >=media-libs/freetype-2.2.1:2
+"
+X_RDEPS="
+ x11-libs/libXext
+ x11-libs/libXxf86vm
+"
+# Rar: althrought -gpl version is nice, it cant do most functions normal rars can
+# nemesi? ( net-libs/libnemesi )
+RDEPEND+="
+ sys-libs/ncurses
+ app-arch/bzip2
+ sys-libs/zlib
+ >=media-video/ffmpeg-0.10.3
+ !bindist? (
+ x86? (
+ win32codecs? ( media-libs/win32codecs )
+ )
+ )
+ a52? ( media-libs/a52dec )
+ aalib? ( media-libs/aalib )
+ alsa? ( media-libs/alsa-lib )
+ amr? ( !bindist? ( media-libs/opencore-amr ) )
+ bidi? ( dev-libs/fribidi )
+ bluray? ( >=media-libs/libbluray-0.2.1 )
+ bs2b? ( media-libs/libbs2b )
+ cdio? ( dev-libs/libcdio )
+ cdparanoia? ( !cdio? ( media-sound/cdparanoia ) )
+ dga? ( x11-libs/libXxf86dga )
+ directfb? ( dev-libs/DirectFB )
+ dts? ( media-libs/libdca )
+ dv? ( media-libs/libdv )
+ dvb? ( virtual/linuxtv-dvb-headers )
+ dvd? ( >=media-libs/libdvdread-4.1.3 )
+ dvdnav? ( >=media-libs/libdvdnav-4.1.3 )
+ encode? (
+ !twolame? ( toolame? ( media-sound/toolame ) )
+ twolame? ( media-sound/twolame )
+ faac? ( media-libs/faac )
+ mp3? ( media-sound/lame )
+ x264? ( >=media-libs/x264-0.0.20100423 )
+ xvid? ( media-libs/xvid )
+ )
+ enca? ( app-i18n/enca )
+ faad? ( media-libs/faad2 )
+ ggi? ( media-libs/libggi media-libs/libggiwmh )
+ gif? ( media-libs/giflib )
+ gsm? ( media-sound/gsm )
+ iconv? ( virtual/libiconv )
+ jack? ( media-sound/jack-audio-connection-kit )
+ jpeg? ( virtual/jpeg )
+ jpeg2k? ( media-libs/openjpeg )
+ ladspa? ( media-libs/ladspa-sdk )
+ libass? ( >=media-libs/libass-0.9.10[enca?] )
+ libcaca? ( media-libs/libcaca )
+ libmpeg2? ( media-libs/libmpeg2 )
+ lirc? ( app-misc/lirc )
+ live? ( media-plugins/live )
+ lzo? ( >=dev-libs/lzo-2 )
+ mad? ( media-libs/libmad )
+ mng? ( media-libs/libmng )
+ mp3? ( media-sound/mpg123 )
+ nas? ( media-libs/nas )
+ nut? ( >=media-libs/libnut-661 )
+ openal? ( media-libs/openal )
+ opengl? ( virtual/opengl )
+ png? ( media-libs/libpng )
+ pnm? ( media-libs/netpbm )
+ pulseaudio? ( media-sound/pulseaudio )
+ rar? (
+ || (
+ app-arch/unrar
+ app-arch/rar
+ )
+ )
+ rtmp? ( media-video/rtmpdump )
+ samba? ( net-fs/samba )
+ sdl? ( media-libs/libsdl )
+ speex? ( media-libs/speex )
+ theora? ( media-libs/libtheora[encode?] )
+ truetype? ( ${FONT_RDEPS} )
+ vaapi? ( x11-libs/libva )
+ vdpau? ( x11-libs/libvdpau )
+ vorbis? ( media-libs/libvorbis )
+ X? ( ${X_RDEPS} )
+ xanim? ( media-video/xanim )
+ xinerama? ( x11-libs/libXinerama )
+ xscreensaver? ( x11-libs/libXScrnSaver )
+ xv? ( x11-libs/libXv )
+ xvmc? ( x11-libs/libXvMC )
+"
+
+X_DEPS="
+ x11-proto/videoproto
+ x11-proto/xf86vidmodeproto
+"
+ASM_DEP="dev-lang/yasm"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ dga? ( x11-proto/xf86dgaproto )
+ dxr3? ( media-video/em8300-libraries )
+ X? ( ${X_DEPS} )
+ xinerama? ( x11-proto/xineramaproto )
+ xscreensaver? ( x11-proto/scrnsaverproto )
+ amd64? ( ${ASM_DEP} )
+ doc? (
+ dev-libs/libxslt app-text/docbook-xml-dtd
+ app-text/docbook-xsl-stylesheets
+ )
+ x86? ( ${ASM_DEP} )
+ x86-fbsd? ( ${ASM_DEP} )
+"
+
+SLOT="0"
+LICENSE="GPL-2"
+if [[ ${PV} != *9999* ]]; then
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+else
+ KEYWORDS=""
+fi
+
+# bindist does not cope with amr codecs (#299405#c6), faac codecs are nonfree, win32codecs are nonfree
+# libcdio support: prefer libcdio over cdparanoia and don't check for cddb w/cdio
+# dvd navigation requires dvd read support
+# ass and freetype font require iconv and ass requires freetype fonts
+# unicode transformations are usefull only with iconv
+# libvorbis require external tremor to work
+# radio requires oss or alsa backend
+# xvmc requires xvideo support
+REQUIRED_USE="bindist? ( !amr !faac !win32codecs )
+ dvdnav? ( dvd )
+ libass? ( truetype )
+ truetype? ( iconv )
+ dxr3? ( X )
+ ggi? ( X )
+ xinerama? ( X )
+ dga? ( X )
+ opengl? ( || ( X aqua ) )
+ osdmenu? ( || ( X aqua ) )
+ vdpau? ( X )
+ vidix? ( X )
+ xscreensaver? ( X )
+ xv? ( X )
+ xvmc? ( xv )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.0_rc4-pkg-config.patch"
+ "${FILESDIR}/${P}-ffmpeg.patch"
+ "${FILESDIR}/${P}-codecid.patch"
+)
+
+pkg_setup() {
+ if [[ ${PV} == *9999* ]]; then
+ elog
+ elog "This is a live ebuild which installs the latest from upstream's"
+ elog "subversion repository, and is unsupported by Gentoo."
+ elog "Everything but bugs in the ebuild itself will be ignored."
+ elog
+ fi
+
+ if use coreavc; then
+ einfo "CoreAVC is a licenced product"
+ einfo "More information at http://code.google.com/p/coreavc-for-linux/"
+ fi
+
+ if use cpudetection; then
+ ewarn
+ ewarn "You've enabled the cpudetection flag. This feature is"
+ ewarn "included mainly for people who want to use the same"
+ ewarn "binary on another system with a different CPU architecture."
+ ewarn "MPlayer will already detect your CPU settings by default at"
+ ewarn "buildtime; this flag is used for runtime detection."
+ ewarn "You won't need this turned on if you are only building"
+ ewarn "mplayer for this system. Also, if your compile fails, try"
+ ewarn "disabling this use flag."
+ fi
+
+ if use custom-cpuopts; then
+ ewarn
+ ewarn "You are using the custom-cpuopts flag which will"
+ ewarn "specifically allow you to enable / disable certain"
+ ewarn "CPU optimizations."
+ ewarn
+ ewarn "Most desktop users won't need this functionality, but it"
+ ewarn "is included for corner cases like cross-compiling and"
+ ewarn "certain profiles. If unsure, disable this flag and MPlayer"
+ ewarn "will automatically detect and use your available CPU"
+ ewarn "optimizations."
+ ewarn
+ ewarn "Using this flag means your build is unsupported, so"
+ ewarn "please make sure your CPU optimization use flags (3dnow"
+ ewarn "3dnowext mmx mmxext sse sse2 ssse3) are properly set."
+ fi
+}
+
+src_unpack() {
+ if [[ ${PV} = *9999* ]]; then
+ subversion_src_unpack
+ cd "${WORKDIR}"
+ rm -rf "${WORKDIR}/${P}/ffmpeg/"
+ ( S="${WORKDIR}/${P}/ffmpeg/" git-2_src_unpack )
+ else
+ unpack ${A}
+ fi
+
+ if [[ ${PV} = *9999* ]] || [[ "${PV%_rc*}" = "${PV}" ]]; then
+ cd "${S}"
+ cp "${FILESDIR}/dump_ffmpeg.sh" . || die
+ chmod +x dump_ffmpeg.sh
+ ./dump_ffmpeg.sh || die
+ fi
+
+ if ! use truetype; then
+ unpack font-arial-iso-8859-1.tar.bz2 \
+ font-arial-iso-8859-2.tar.bz2 \
+ font-arial-cp1250.tar.bz2
+ fi
+}
+
+src_prepare() {
+ local svf=snapshot_version
+ if [[ ${PV} = *9999* ]]; then
+ # Set SVN version manually
+ subversion_wc_info
+ printf "${ESVN_WC_REVISION}" > $svf
+ fi
+ if [ ! -f VERSION ] ; then
+ [ -f "$svf" ] || die "Missing ${svf}. Did you generate your snapshot with prepare_mplayer.sh?"
+ local sv=$(<$svf)
+ printf "SVN-r${sv} (Gentoo)" > VERSION
+ fi
+
+ # fix path to bash executable in configure scripts
+ sed -i -e "1c\#!${EPREFIX}/bin/bash" configure version.sh || die
+
+ cd ${S}
+
+ use stereoscopic && epatch "${FILESDIR}/extra/${PN}-stereoscopic-${PV}.patch"
+
+ use coreavc && epatch "${FILESDIR}/extra/${PN}-coreavc-${PV}.patch"
+
+ use vaapi && epatch "${FILESDIR}/extra/mplayer-vaapi-${PV}.patch"
+
+ base_src_prepare
+}
+
+src_configure() {
+ local myconf=""
+ local uses i
+
+ # set LINGUAS
+ [[ -n $LINGUAS ]] && LINGUAS="${LINGUAS/da/dk}"
+
+ # mplayer ebuild uses "use foo || --disable-foo" to forcibly disable
+ # compilation in almost every situation. The reason for this is
+ # because if --enable is used, it will force the build of that option,
+ # regardless of whether the dependency is available or not.
+
+ ###################
+ #Optional features#
+ ###################
+ # disable svga since we don't want it
+ # disable arts since we don't have kde3
+ # always disable internal ass
+ myconf+="
+ --disable-svga --disable-svgalib_helper
+ --disable-ass-internal
+ --disable-arts
+ --disable-kai
+ $(use_enable network networking)
+ $(use_enable joystick)
+ "
+ uses="bl bluray enca ftp rtc" # nemesi <- not working with in-tree ebuild
+ myconf+=" --disable-nemesi" # nemesi automagic disable
+ for i in ${uses}; do
+ use ${i} || myconf+=" --disable-${i}"
+ done
+ use bidi || myconf+=" --disable-fribidi"
+ use ipv6 || myconf+=" --disable-inet6"
+ use libass || myconf+=" --disable-ass"
+ use nut || myconf+=" --disable-libnut"
+ use rar || myconf+=" --disable-unrarexec"
+ use samba || myconf+=" --disable-smb"
+ use lirc || myconf+=" --disable-lirc --disable-lircc --disable-apple-ir"
+
+ # libcdio support: prefer libcdio over cdparanoia
+ # don't check for cddb w/cdio
+ if use cdio; then
+ myconf+=" --disable-cdparanoia"
+ else
+ myconf+=" --disable-libcdio"
+ use cdparanoia || myconf+=" --disable-cdparanoia"
+ use cddb || myconf+=" --disable-cddb"
+ fi
+
+ ################################
+ # DVD read, navigation support #
+ ################################
+ #
+ # dvdread - accessing a DVD
+ # dvdnav - navigation of menus
+ #
+ # use external libdvdcss, dvdread and dvdnav
+ myconf+=" --disable-dvdread-internal --disable-libdvdcss-internal"
+ use dvd || myconf+=" --disable-dvdread"
+ use dvdnav || myconf+=" --disable-dvdnav"
+
+ #############
+ # Subtitles #
+ #############
+ #
+ # SRT/ASS/SSA (subtitles) requires freetype support
+ # freetype support requires iconv
+ # iconv optionally can use unicode
+ use truetype || myconf+=" --disable-freetype"
+ use iconv || myconf+=" --disable-iconv --charset=noconv"
+ use iconv && use unicode && myconf+=" --charset=UTF-8"
+
+ #####################################
+ # DVB / Video4Linux / Radio support #
+ #####################################
+ myconf+=" --disable-tv-bsdbt848"
+ # broken upstream, won't work with recent kernels
+ myconf+=" --disable-ivtv"
+ # gone since linux-headers-2.6.38
+ myconf+=" --disable-tv-v4l1"
+ if { use dvb || use v4l || use pvr || use radio; }; then
+ use dvb || myconf+=" --disable-dvb"
+ use pvr || myconf+=" --disable-pvr"
+ use v4l || myconf+=" --disable-tv-v4l2"
+ if use radio && { use dvb || use v4l; }; then
+ myconf+="
+ --enable-radio
+ $(use_enable encode radio-capture)
+ "
+ else
+ myconf+="
+ --disable-radio-v4l2
+ --disable-radio-bsdbt848
+ "
+ fi
+ else
+ myconf+="
+ --disable-tv
+ --disable-tv-v4l2
+ --disable-radio
+ --disable-radio-v4l2
+ --disable-radio-bsdbt848
+ --disable-dvb
+ --disable-v4l2
+ --disable-pvr"
+ fi
+
+ ##########
+ # Codecs #
+ ##########
+ myconf+=" --disable-musepack" # Use internal musepack codecs for SV7 and SV8 support
+ myconf+=" --disable-libmpeg2-internal" # always use system media-libs/libmpeg2
+ use dts || myconf+=" --disable-libdca"
+ # Disable internal mp3lib, bug #384849
+ # Samuli Suominen: Looks like MPlayer in Portage is using internal mp3lib by
+ # default, where as mpg123 upstream has incorporated all the optimizations
+ # from mplayer's mp3lib in libmpg123 and more.
+ # It makes very little sense to use the internal copy as default anymore.
+ myconf+=" --disable-mp3lib"
+ if ! use mp3; then
+ myconf+="
+ --disable-mp3lame
+ --disable-mpg123
+ "
+ fi
+ uses="a52 bs2b dv gsm lzo rtmp"
+ for i in ${uses}; do
+ use ${i} || myconf+=" --disable-lib${i}"
+ done
+ use amr || myconf+=" --disable-libopencore_amrnb --disable-libopencore_amrwb"
+
+ uses="faad gif jpeg libmpeg2 live mad mng png pnm speex tga theora xanim"
+ for i in ${uses}; do
+ use ${i} || myconf+=" --disable-${i}"
+ done
+ use jpeg2k || myconf+=" --disable-libopenjpeg"
+ if use vorbis || use tremor; then
+ use tremor || myconf+=" --disable-tremor-internal"
+ use vorbis || myconf+=" --disable-libvorbis"
+ else
+ myconf+="
+ --disable-tremor-internal
+ --disable-tremor
+ --disable-libvorbis
+ "
+ fi
+ # Encoding
+ uses="faac x264 xvid toolame twolame"
+ if use encode; then
+ for i in ${uses}; do
+ use ${i} || myconf+=" --disable-${i}"
+ done
+ else
+ myconf+=" --disable-mencoder"
+ for i in ${uses}; do
+ myconf+=" --disable-${i}"
+ use ${i} && elog "Useflag \"${i}\" will only be useful for encoding, i.e., with \"encode\" useflag enabled."
+ done
+ fi
+
+ #################
+ # Binary codecs #
+ #################
+ # bug 213836
+ if ! use x86 || ! use win32codecs; then
+ use quicktime || myconf+=" --disable-qtx"
+ fi
+
+ ######################
+ # RealPlayer support #
+ ######################
+ # Realplayer support shows up in four places:
+ # - libavcodec (internal)
+ # - win32codecs
+ # - realcodecs (win32codecs libs)
+ # - realcodecs (realplayer libs)
+
+ # internal
+ use real || myconf+=" --disable-real"
+
+ # Real binary codec support only available on x86, amd64
+ if use real; then
+ use x86 && myconf+=" --codecsdir=/opt/RealPlayer/codecs"
+ use amd64 && myconf+=" --codecsdir=/usr/$(get_libdir)/codecs"
+ fi
+ myconf+=" $(use_enable win32codecs win32dll)"
+
+ ################
+ # Video Output #
+ ################
+ uses="directfb md5sum sdl"
+ for i in ${uses}; do
+ use ${i} || myconf+=" --disable-${i}"
+ done
+ use aalib || myconf+=" --disable-aa"
+ use fbcon || myconf+=" --disable-fbdev"
+ use fbcon && use video_cards_s3virge && myconf+=" --enable-s3fb"
+ use libcaca || myconf+=" --disable-caca"
+ use zoran || myconf+=" --disable-zr"
+
+ if ! use kernel_linux || ! use video_cards_mga; then
+ myconf+=" --disable-mga --disable-xmga"
+ fi
+
+ if use video_cards_tdfx; then
+ myconf+="
+ $(use_enable video_cards_tdfx tdfxvid)
+ $(use_enable fbcon tdfxfb)
+ "
+ else
+ myconf+="
+ --disable-3dfx
+ --disable-tdfxvid
+ --disable-tdfxfb
+ "
+ fi
+
+ # sun card, disable by default, see bug #258729
+ myconf+=" --disable-xvr100"
+
+ ################
+ # Audio Output #
+ ################
+ myconf+=" --disable-esd"
+ uses="alsa jack ladspa nas openal"
+ for i in ${uses}; do
+ use ${i} || myconf+=" --disable-${i}"
+ done
+ use pulseaudio || myconf+=" --disable-pulse"
+ if ! use radio; then
+ use oss || myconf+=" --disable-ossaudio"
+ fi
+
+ ####################
+ # Advanced Options #
+ ####################
+ # Platform specific flags, hardcoded on amd64 (see below)
+ use cpudetection && myconf+=" --enable-runtime-cpudetection"
+
+ uses="3dnow 3dnowext altivec mmx mmxext shm sse sse2 ssse3"
+ for i in ${uses}; do
+ myconf+=" $(use_enable ${i})"
+ done
+
+ use debug && myconf+=" --enable-debug=3"
+
+ if use x86 && gcc-specs-pie; then
+ filter-flags -fPIC -fPIE
+ append-ldflags -nopie
+ fi
+
+ ###########################
+ # X enabled configuration #
+ ###########################
+ myconf+=" --disable-gui"
+ myconf+=" --disable-vesa"
+ uses="dxr3 ggi vdpau xinerama xv"
+ for i in ${uses}; do
+ use ${i} || myconf+=" --disable-${i}"
+ done
+ use vaapi && myconf+=" --enable-vaapi"
+ use dga || myconf+=" --disable-dga1 --disable-dga2"
+ use opengl || myconf+=" --disable-gl"
+ use osdmenu && myconf+=" --enable-menu"
+ use vidix || myconf+=" --disable-vidix --disable-vidix-pcidb"
+ use xscreensaver || myconf+=" --disable-xss"
+ use X || myconf+=" --disable-x11"
+ if use xvmc; then
+ myconf+=" --enable-xvmc --with-xvmclib=XvMCW"
+ else
+ myconf+=" --disable-xvmc"
+ fi
+
+ ############################
+ # OSX (aqua) configuration #
+ ############################
+ if use aqua; then
+ myconf+="
+ --enable-macosx-finder
+ --enable-macosx-bundle
+ "
+ fi
+
+ tc-export PKG_CONFIG
+ ./configure \
+ --cc="$(tc-getCC)" \
+ --host-cc="$(tc-getBUILD_CC)" \
+ --prefix="${EPREFIX}/usr" \
+ --bindir="${EPREFIX}/usr/bin" \
+ --libdir="${EPREFIX}/usr/$(get_libdir)" \
+ --confdir="${EPREFIX}/etc/mplayer" \
+ --datadir="${EPREFIX}/usr/share/mplayer${namesuf}" \
+ --mandir="${EPREFIX}/usr/share/man" \
+ --disable-ffmpeg_a \
+ ${myconf} || die
+}
+
+src_compile() {
+ base_src_compile
+ # Build only user-requested docs if they're available.
+ if use doc ; then
+ # select available languages from $LINGUAS
+ LINGUAS=${LINGUAS/zh/zh_CN}
+ local ALLOWED_LINGUAS="cs de en es fr hu it pl ru zh_CN"
+ local BUILT_DOCS=""
+ for i in ${LINGUAS} ; do
+ has ${i} ${ALLOWED_LINGUAS} && BUILT_DOCS+=" ${i}"
+ done
+ if [[ -z $BUILT_DOCS ]]; then
+ emake -j1 html-chunked
+ else
+ for i in ${BUILT_DOCS}; do
+ emake -j1 html-chunked-${i}
+ done
+ fi
+ fi
+}
+
+src_install() {
+ local i
+
+ emake \
+ DESTDIR="${D}" \
+ INSTALLSTRIP="" \
+ install
+
+ dodoc AUTHORS Changelog Copyright README etc/codecs.conf
+
+ docinto tech/
+ dodoc DOCS/tech/{*.txt,MAINTAINERS,mpsub.sub,playtree,TODO,wishlist}
+ docinto TOOLS/
+ dodoc -r TOOLS
+ if use real; then
+ docinto tech/realcodecs/
+ dodoc DOCS/tech/realcodecs/*
+ fi
+ docinto tech/mirrors/
+ dodoc DOCS/tech/mirrors/*
+
+ if use doc; then
+ docinto html/
+ dohtml -r "${S}"/DOCS/HTML/*
+ fi
+
+ if ! use truetype; then
+ dodir /usr/share/mplayer/fonts
+ # Do this generic, as the mplayer people like to change the structure
+ # of their zips ...
+ for i in $(find "${WORKDIR}/" -type d -name 'font-arial-*'); do
+ cp -pPR "${i}" "${ED}/usr/share/mplayer/fonts"
+ done
+ # Fix the font symlink ...
+ rm -rf "${ED}/usr/share/mplayer/font"
+ dosym fonts/font-arial-14-iso-8859-1 /usr/share/mplayer/font
+ fi
+
+ insinto /etc/mplayer
+ newins "${S}/etc/example.conf" mplayer.conf
+ cat >> "${ED}/etc/mplayer/mplayer.conf" << _EOF_
+# Config options can be section specific, global
+# options should go in the default section
+[default]
+_EOF_
+ doins "${S}/etc/input.conf"
+ if use osdmenu; then
+ doins "${S}/etc/menu.conf"
+ fi
+
+ if use truetype; then
+ cat >> "${ED}/etc/mplayer/mplayer.conf" << _EOF_
+fontconfig=1
+subfont-osd-scale=4
+subfont-text-scale=3
+_EOF_
+ fi
+
+ # bug 256203
+ if use rar; then
+ cat >> "${ED}/etc/mplayer/mplayer.conf" << _EOF_
+unrarexec=${EPREFIX}/usr/bin/unrar
+_EOF_
+ fi
+
+ dosym ../../../etc/mplayer/mplayer.conf /usr/share/mplayer/mplayer.conf
+ newbin "${S}/TOOLS/midentify.sh" midentify
+}
+
+pkg_preinst() {
+ [[ -d ${EROOT}/usr/share/mplayer/Skin/default ]] && \
+ rm -rf "${EROOT}/usr/share/mplayer/Skin/default"
+}
+
+pkg_postrm() {
+ # Cleanup stale symlinks
+ [ -L "${EROOT}/usr/share/mplayer/font" -a \
+ ! -e "${EROOT}/usr/share/mplayer/font" ] && \
+ rm -f "${EROOT}/usr/share/mplayer/font"
+
+ [ -L "${EROOT}/usr/share/mplayer/subfont.ttf" -a \
+ ! -e "${EROOT}/usr/share/mplayer/subfont.ttf" ] && \
+ rm -f "${EROOT}/usr/share/mplayer/subfont.ttf"
+}