summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authornezumisama2015-06-14 17:54:37 +0200
committernezumisama2015-06-14 17:54:37 +0200
commit34e6d3e8af4ca718c02396176f184599eb8e1da5 (patch)
tree295bef41b4861d2e5c8c419c7a002635525a21da
downloadaur-34e6d3e8af4ca718c02396176f184599eb8e1da5.tar.gz
Initial commit.
-rw-r--r--.SRCINFO75
-rw-r--r--PKGBUILD83
-rw-r--r--giflib-5.0.patch111
-rw-r--r--giflib-5.1.patch38
-rw-r--r--input_buffer_padding.patch13
-rw-r--r--mplayer2.install11
-rw-r--r--quvi-0.9.patch98
-rw-r--r--theora.patch284
-rw-r--r--vo_gl_locale_fix.patch26
9 files changed, 739 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..1a568382fef8
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,75 @@
+pkgbase = mplayer2
+ pkgdesc = Advanced general-purpose media player. A fork of the original MPlayer project
+ pkgver = 20131009
+ pkgrel = 9
+ url = http://www.mplayer2.org/
+ install = mplayer2.install
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = mesa
+ makedepends = libgl
+ makedepends = unzip
+ makedepends = yasm
+ makedepends = python
+ makedepends = python-docutils
+ makedepends = git
+ depends = a52dec
+ depends = aalib
+ depends = cdparanoia
+ depends = desktop-file-utils
+ depends = enca
+ depends = faad2
+ depends = ffmpeg
+ depends = fontconfig
+ depends = freetype2
+ depends = jack
+ depends = ladspa
+ depends = lame
+ depends = libass
+ depends = libbluray
+ depends = libcaca
+ depends = libcdio-paranoia
+ depends = libdca
+ depends = libdvdcss
+ depends = libdvdnav
+ depends = libdvdread
+ depends = libgl
+ depends = libjpeg
+ depends = libmad
+ depends = libpulse
+ depends = libquvi
+ depends = libvdpau
+ depends = libxinerama
+ depends = libxss
+ depends = libxv
+ depends = libxxf86dga
+ depends = libxxf86vm
+ depends = lirc-utils
+ depends = mpg123
+ depends = ncurses
+ depends = sdl
+ depends = ttf-dejavu
+ depends = giflib
+ provides = mplayer
+ conflicts = mplayer
+ options = !emptydirs
+ backup = etc/mplayer/codecs.conf
+ backup = etc/mplayer/input.conf
+ source = https://github.com/Barthalion/mplayer2/archive/6c87a981baa4972fd71c25dfddea017b5a972e89.tar.gz
+ source = giflib-5.0.patch
+ source = giflib-5.1.patch
+ source = quvi-0.9.patch
+ source = vo_gl_locale_fix.patch
+ source = input_buffer_padding.patch
+ source = theora.patch
+ sha256sums = e2e0e7ec17d4f206daa7b8cdd6e0f4e58c13e9ebf9b82d4041a18ccbb34013d5
+ sha256sums = 20706ebb35e7c1935ae263c48d623a878db3b634ca575927913f56d9ce059c7a
+ sha256sums = e77724d0f684961fdebdb64f6fbb15f1ced8594b467decccd06ece67a8f43fb0
+ sha256sums = c8aedad5889c0146bdc70f7744dc75c9b2e97c00973c965358224f2bb7eaea6b
+ sha256sums = 6b0990e8eb011358292fc3f519a1d37cf9fbf6cf38384414a1edb356a21d2184
+ sha256sums = e4309ab77add15eb36f324646460a9307d2349c1345d0826508c3fab70c7dbde
+ sha256sums = 31b4699024b7ef2410ce4d446f2082f80ef57794e20c4632a9733a66a443cf8d
+
+pkgname = mplayer2
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..9da5051c3a47
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,83 @@
+# Maintainer: AppleBloom <rat.o.drat@gmail.com>
+# Previous maintainer: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
+# Contributor: Martin Panter <vadmium+aur@gmail.com>
+# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
+# Contributor: ma-79 <ma65547@gmail.com>
+
+pkgname=mplayer2
+pkgver=20131009
+pkgrel=9
+pkgdesc='Advanced general-purpose media player. A fork of the original MPlayer project'
+arch=('i686' 'x86_64')
+license=('GPL')
+url='http://www.mplayer2.org/'
+install=$pkgname.install
+depends=('a52dec' 'aalib' 'cdparanoia' 'desktop-file-utils' 'enca' 'faad2' 'ffmpeg'
+ 'fontconfig' 'freetype2' 'jack' 'ladspa' 'lame' 'libass' 'libbluray'
+ 'libcaca' 'libcdio-paranoia' 'libdca' 'libdvdcss' 'libdvdnav' 'libdvdread'
+ 'libgl' 'libjpeg' 'libmad' 'libpulse' 'libquvi' 'libvdpau'
+ 'libxinerama' 'libxss' 'libxv' 'libxxf86dga' 'libxxf86vm' 'lirc-utils'
+ 'mpg123' 'ncurses' 'sdl' 'ttf-dejavu' 'giflib')
+makedepends=('mesa' 'libgl' 'unzip' 'yasm' 'python' 'python-docutils' 'git')
+backup=('etc/mplayer/codecs.conf' 'etc/mplayer/input.conf')
+provides=('mplayer')
+conflicts=('mplayer')
+options=(!emptydirs)
+#_commit=2c378c71a4d9b1df382db9aa787b646628b4e3f9
+_commit=6c87a981baa4972fd71c25dfddea017b5a972e89
+source=(https://github.com/Barthalion/mplayer2/archive/$_commit.tar.gz
+# http://git.mplayer2.org/mplayer2/snapshot/mplayer2-$_commit.tar.bz2
+ giflib-5.0.patch
+ giflib-5.1.patch
+ quvi-0.9.patch
+ vo_gl_locale_fix.patch
+ input_buffer_padding.patch
+ theora.patch)
+sha256sums=('e2e0e7ec17d4f206daa7b8cdd6e0f4e58c13e9ebf9b82d4041a18ccbb34013d5'
+# '141f8a641acfd1fcd249c096f712bab2ecaaa7034a7e0e77268a92ad85a4a90b'
+ '20706ebb35e7c1935ae263c48d623a878db3b634ca575927913f56d9ce059c7a'
+ 'e77724d0f684961fdebdb64f6fbb15f1ced8594b467decccd06ece67a8f43fb0'
+ 'c8aedad5889c0146bdc70f7744dc75c9b2e97c00973c965358224f2bb7eaea6b'
+ '6b0990e8eb011358292fc3f519a1d37cf9fbf6cf38384414a1edb356a21d2184'
+ 'e4309ab77add15eb36f324646460a9307d2349c1345d0826508c3fab70c7dbde'
+ '31b4699024b7ef2410ce4d446f2082f80ef57794e20c4632a9733a66a443cf8d')
+
+prepare() {
+ cd "$pkgname-$_commit"
+ sed 's/gmplayer/mplayer/g' -i etc/mplayer.desktop
+ find -type f -exec sed -e 's/python3/python/' -i {} \;
+ patch -Np1 -i ../giflib-5.0.patch
+ patch -Np1 -i ../giflib-5.1.patch
+ patch -Np1 -i ../quvi-0.9.patch
+ patch -Np1 -i ../vo_gl_locale_fix.patch
+ patch -Np1 -i ../input_buffer_padding.patch
+ patch -Np0 -i ../theora.patch
+}
+
+build() {
+ cd "$pkgname-$_commit"
+
+ LDFLAGS+=" -ltheoradec" \
+ ./configure --prefix=/usr --confdir=/etc/mplayer \
+ --enable-translation --language=all \
+ --enable-runtime-cpudetection \
+ --enable-joystick \
+ --enable-gif \
+ --disable-speex \
+ --disable-openal \
+ --disable-libdv \
+ --disable-musepack
+ make
+}
+
+package() {
+ cd "$pkgname-$_commit"
+ make DESTDIR="$pkgdir" install
+
+ install -Dm644 etc/{codecs.conf,input.conf,example.conf} "$pkgdir"/etc/mplayer/
+ install -dm755 "$pkgdir"/usr/share/mplayer/
+ ln -s /usr/share/fonts/TTF/DejaVuSans.ttf "$pkgdir"/usr/share/mplayer/subfont.ttf
+
+ install -dm755 "$pkgdir"/usr/share/applications/
+ install -m 644 etc/mplayer.desktop "$pkgdir"/usr/share/applications/
+}
diff --git a/giflib-5.0.patch b/giflib-5.0.patch
new file mode 100644
index 000000000000..9eaa6e98e1fc
--- /dev/null
+++ b/giflib-5.0.patch
@@ -0,0 +1,111 @@
+diff --git a/libvo/vo_gif89a.c b/libvo/vo_gif89a.c
+index b808f81..c61d86c 100644
+--- a/libvo/vo_gif89a.c
++++ b/libvo/vo_gif89a.c
+@@ -196,7 +196,11 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width,
+ mp_msg(MSGT_VO, MSGL_ERR, "GIF89a: Some functionality has been disabled.\n");
+ #endif
+
++#if GIFLIB_MAJOR > 4
++ new_gif = EGifOpenFileName(gif_filename, 0, NULL);
++#else
+ new_gif = EGifOpenFileName(gif_filename, 0);
++#endif
+ if (new_gif == NULL) {
+ mp_msg(MSGT_VO, MSGL_ERR, "GIF89a: error opening file \"%s\" for output.\n", gif_filename);
+ return 1;
+@@ -215,7 +219,11 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width,
+ return 1;
+ }
+
++#if GIFLIB_MAJOR > 4
++ reduce_cmap = GifMakeMapObject(256, NULL);
++#else
+ reduce_cmap = MakeMapObject(256, NULL);
++#endif
+ if (reduce_cmap == NULL) {
+ free(slice_data); slice_data = NULL;
+ free(reduce_data); reduce_data = NULL;
+@@ -267,7 +275,11 @@ static int gif_reduce(int width, int height, uint8_t *src, uint8_t *dst, GifColo
+ }
+
+ R = Ra; G = Ga; B = Ba;
++#if GIFLIB_MAJOR > 4
++ return GifQuantizeBuffer(width, height, &size, R, G, B, dst, colors);
++#else
+ return QuantizeBuffer(width, height, &size, R, G, B, dst, colors);
++#endif
+ }
+
+ static void flip_page(void)
+@@ -365,8 +377,11 @@ static void uninit(void)
+ free(gif_filename);
+ free(slice_data);
+ free(reduce_data);
++#if GIFLIB_MAJOR > 4
++ if (reduce_cmap != NULL) GifFreeMapObject(reduce_cmap);
++#else
+ if (reduce_cmap != NULL) FreeMapObject(reduce_cmap);
+-
++#endif
+ // set the pointers back to null.
+ new_gif = NULL;
+ gif_filename = NULL;
+
+diff --git a/configure b/configure
+index 95a5ae8..d9c826f 100755
+--- a/configure
++++ b/configure
+@@ -3659,6 +3659,7 @@ if test "$_gif" = auto ; then
+ _gif=no
+ for _ld_gif in "-lungif" "-lgif" ; do
+ statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
++ statement_check gif_lib.h 'GifQuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
+ done
+ fi
+
+diff --git a/libmpdemux/demux_gif.c b/libmpdemux/demux_gif.c
+index eee7a85..a764474 100644
+--- a/libmpdemux/demux_gif.c
++++ b/libmpdemux/demux_gif.c
+@@ -44,6 +44,16 @@ typedef struct {
+
+ #define GIF_SIGNATURE (('G' << 16) | ('I' << 8) | 'F')
+
++static void PrintGifError(errcode)
++{
++ char *Err = GifErrorString(errcode);
++
++ if (Err != NULL)
++ fprintf(stderr, "\nGIF-LIB error: %s.\n", Err);
++ else
++ fprintf(stderr, "\nGIF-LIB undefined error %d.\n", errcode);
++}
++
+ #ifndef CONFIG_GIF_TVT_HACK
+ // not supported by certain versions of the library
+ static int my_read_gif(GifFileType *gif, uint8_t *buf, int len)
+@@ -240,6 +250,7 @@ static demuxer_t* demux_open_gif(demuxer_t* demuxer)
+ gif_priv_t *priv = calloc(1, sizeof(gif_priv_t));
+ sh_video_t *sh_video = NULL;
+ GifFileType *gif = NULL;
++ int GifError;
+
+ priv->current_pts = 0;
+ demuxer->seekable = 0; // FIXME
+@@ -254,12 +265,12 @@ static demuxer_t* demux_open_gif(demuxer_t* demuxer)
+ // not read from the beginning of the file and the command will fail.
+ // with this hack enabled, you will lose the ability to stream a GIF.
+ lseek(demuxer->stream->fd, 0, SEEK_SET);
+- gif = DGifOpenFileHandle(demuxer->stream->fd);
++ gif = DGifOpenFileHandle(demuxer->stream->fd, &GifError);
+ #else
+- gif = DGifOpen(demuxer->stream, my_read_gif);
++ gif = DGifOpen(demuxer->stream, my_read_gif, &GifError);
+ #endif
+ if (!gif) {
+- PrintGifError();
++ PrintGifError(GifError);
+ free(priv);
+ return NULL;
+ }
diff --git a/giflib-5.1.patch b/giflib-5.1.patch
new file mode 100644
index 000000000000..216c0c026b79
--- /dev/null
+++ b/giflib-5.1.patch
@@ -0,0 +1,38 @@
+diff -ur mplayer2/libmpdemux/demux_gif.c mplayer2-patched/libmpdemux/demux_gif.c
+--- mplayer2/libmpdemux/demux_gif.c 2014-06-15 23:14:22.159745049 +0400
++++ mplayer2-patched/libmpdemux/demux_gif.c 2014-06-15 23:18:06.329743015 +0400
+@@ -311,7 +311,15 @@
+ {
+ gif_priv_t *priv = demuxer->priv;
+ if (!priv) return;
++#if GIFLIB_MAJOR == 5
++ #if GIFLIB_MINOR >= 1
++ if (priv->gif && DGifCloseFile(priv->gif, NULL) == GIF_ERROR)
++ #else
++ if (priv->gif && DGifCloseFile(priv->gif) == GIF_ERROR)
++ #endif
++#else
+ if (priv->gif && DGifCloseFile(priv->gif) == GIF_ERROR)
++#endif
+ PrintGifError();
+ free(priv->refimg);
+ free(priv);
+diff -ur mplayer2/libvo/vo_gif89a.c mplayer2-patched/libvo/vo_gif89a.c
+--- mplayer2/libvo/vo_gif89a.c 2014-06-15 23:16:34.426410512 +0400
++++ mplayer2-patched/libvo/vo_gif89a.c 2014-06-15 23:15:41.833077660 +0400
+@@ -370,7 +370,15 @@
+ MPLAYER_VERSION, VO_GIF_REVISION,
+ "joey@nicewarrior.org");
+ EGifPutComment(new_gif, temp);
++#if GIFLIB_MAJOR == 5
++ #if GIFLIB_MINOR >= 1
++ EGifCloseFile(new_gif, NULL); // also frees gif storage space.
++ #else
+ EGifCloseFile(new_gif); // also frees gif storage space.
++ #endif
++#else
++ EGifCloseFile(new_gif); // also frees gif storage space.
++#endif
+ }
+
+ // free our allocated ram
diff --git a/input_buffer_padding.patch b/input_buffer_padding.patch
new file mode 100644
index 000000000000..b8c31379f7e6
--- /dev/null
+++ b/input_buffer_padding.patch
@@ -0,0 +1,13 @@
+diff -Naur mplayer2.old/libmpdemux/demuxer.h mplayer2/libmpdemux/demuxer.h
+--- mplayer2.old/libmpdemux/demuxer.h 2014-07-27 12:52:23.710581692 +0200
++++ mplayer2/libmpdemux/demuxer.h 2014-07-27 12:54:10.541535634 +0200
+@@ -121,7 +121,7 @@
+ #define SEEK_BACKWARD (1 << 3)
+
+ // demux_lavf can pass lavf buffers using FF_INPUT_BUFFER_PADDING_SIZE instead
+-#define MP_INPUT_BUFFER_PADDING_SIZE 16
++#define MP_INPUT_BUFFER_PADDING_SIZE 32
+
+ typedef struct demux_stream {
+ int buffer_pos; // current buffer position
+
diff --git a/mplayer2.install b/mplayer2.install
new file mode 100644
index 000000000000..660593cf5668
--- /dev/null
+++ b/mplayer2.install
@@ -0,0 +1,11 @@
+post_install() {
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/quvi-0.9.patch b/quvi-0.9.patch
new file mode 100644
index 000000000000..09d55903615f
--- /dev/null
+++ b/quvi-0.9.patch
@@ -0,0 +1,98 @@
+This makes mplayer2 work with the new 0.9 branch of libquvi.
+Please send issues to rat dot o dot drat at gmail dot com.
+diff -Naur mplayer2/configure mplayer2.new/configure
+--- mplayer2/configure 2014-02-24 19:37:11.154636312 +0100
++++ mplayer2.new/configure 2014-02-24 19:39:33.979771836 +0100
+@@ -3187,7 +3187,7 @@
+ echocheck "libquvi support"
+ if test "$_libquvi" = auto ; then
+ _libquvi=no
+- if pkg_config_add 'libquvi >= 0.4.1' ; then
++ if pkg_config_add 'libquvi-0.9' ; then
+ _libquvi=yes
+ fi
+ fi
+diff -Naur mplayer2/stream/quvi.c mplayer2.new/stream/quvi.c
+--- mplayer2/stream/quvi.c 2014-02-24 19:37:08.347929591 +0100
++++ mplayer2.new/stream/quvi.c 2014-02-24 19:40:08.693559705 +0100
+@@ -15,7 +15,7 @@
+ * with mplayer2. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+-#include <quvi/quvi.h>
++#include <quvi.h>
+
+ #include "talloc.h"
+ #include "mp_msg.h"
+@@ -24,19 +24,17 @@
+
+ struct mp_resolve_result *mp_resolve_quvi(const char *url, struct MPOpts *opts)
+ {
+- QUVIcode rc;
+-
+- quvi_t q;
+- rc = quvi_init(&q);
+- if (rc != QUVI_OK)
++ quvi_t q = quvi_new();
++ if (quvi_ok(q) == QUVI_FALSE)
+ return NULL;
+
+ // Don't try to use quvi on an URL that's not directly supported, since
+ // quvi will do a network access anyway in order to check for HTTP
+ // redirections etc.
+ // The documentation says this will fail on "shortened" URLs.
+- if (quvi_supported(q, (char *)url) != QUVI_OK) {
+- quvi_close(&q);
++ if (quvi_supports(q, (char *) url, QUVI_SUPPORTS_MODE_OFFLINE,
++ QUVI_SUPPORTS_TYPE_ANY) == QUVI_FALSE) {
++ quvi_free(q);
+ return NULL;
+ }
+
+@@ -48,13 +46,16 @@
+ // That call requires an extra net access. quvi_next_media_url() doesn't
+ // seem to do anything useful. So we can't really do anything useful
+ // except pass through the user's format setting.
+- quvi_setopt(q, QUVIOPT_FORMAT, opts->quvi_format);
+-
+- quvi_media_t m;
+- rc = quvi_parse(q, (char *)url, &m);
+- if (rc != QUVI_OK) {
+- mp_msg(MSGT_OPEN, MSGL_ERR, "[quvi] %s\n", quvi_strerror(q, rc));
+- quvi_close(&q);
++ quvi_media_t m = quvi_media_new(q, (char *) url);
++ if (quvi_ok(q) == QUVI_FALSE) {
++ mp_msg(MSGT_OPEN, MSGL_ERR, "[quvi] %s\n", quvi_errmsg(q));
++ quvi_free(q);
++ return NULL;
++ }
++ quvi_media_stream_select(m, opts->quvi_format);
++ if (quvi_ok(q) == QUVI_FALSE) {
++ mp_msg(MSGT_OPEN, MSGL_ERR, "[quvi] %s\n", quvi_errmsg(q));
++ quvi_free(q);
+ return NULL;
+ }
+
+@@ -62,15 +63,17 @@
+ talloc_zero(NULL, struct mp_resolve_result);
+
+ char *val;
+-
+- if (quvi_getprop(m, QUVIPROP_MEDIAURL, &val) == QUVI_OK)
++
++ quvi_media_get(m, QUVI_MEDIA_STREAM_PROPERTY_URL, &val);
++ if (quvi_ok(q) == QUVI_TRUE)
+ result->url = talloc_strdup(result, val);
+
+- if (quvi_getprop(m, QUVIPROP_PAGETITLE, &val) == QUVI_OK)
++ quvi_media_get(m, QUVI_MEDIA_PROPERTY_TITLE, &val);
++ if (quvi_ok(q) == QUVI_TRUE)
+ result->title = talloc_strdup(result, val);
+
+- quvi_parse_close(&m);
+- quvi_close(&q);
++ quvi_media_free(m);
++ quvi_free(q);
+
+ if (!result->url) {
+ talloc_free(result);
diff --git a/theora.patch b/theora.patch
new file mode 100644
index 000000000000..9c2009745ea4
--- /dev/null
+++ b/theora.patch
@@ -0,0 +1,284 @@
+This patch allows to build with newer versions of libtheora.
+Source: https://svnweb.freebsd.org/ports?view=revision&revision=385026
+--- libmpcodecs/vd_theora.c.orig 2015-03-25 00:52:12.768575000 +0100
++++ libmpcodecs/vd_theora.c 2015-03-25 01:17:34.162174000 +0100
+@@ -39,22 +39,23 @@
+
+ LIBVD_EXTERN(theora)
+
+-#include <theora/theora.h>
++#include <theora/theoradec.h>
+
+ #define THEORA_NUM_HEADER_PACKETS 3
+
+ typedef struct theora_struct_st {
+- theora_state st;
+- theora_comment cc;
+- theora_info inf;
++ th_setup_info *tsi;
++ th_dec_ctx *tctx;
++ th_comment tc;
++ th_info ti;
+ } theora_struct_t;
+
+ /** Convert Theora pixelformat to the corresponding IMGFMT_ */
+-static uint32_t theora_pixelformat2imgfmt(theora_pixelformat fmt){
++static uint32_t theora_pixelformat2imgfmt(th_pixel_fmt fmt){
+ switch(fmt) {
+- case OC_PF_420: return IMGFMT_YV12;
+- case OC_PF_422: return IMGFMT_422P;
+- case OC_PF_444: return IMGFMT_444P;
++ case TH_PF_420: return IMGFMT_YV12;
++ case TH_PF_422: return IMGFMT_422P;
++ case TH_PF_444: return IMGFMT_444P;
+ }
+ return 0;
+ }
+@@ -64,7 +65,7 @@
+ theora_struct_t *context = sh->context;
+ switch(cmd) {
+ case VDCTRL_QUERY_FORMAT:
+- if (*(int*)arg == theora_pixelformat2imgfmt(context->inf.pixelformat))
++ if (*(int*)arg == theora_pixelformat2imgfmt(context->ti.pixel_fmt))
+ return CONTROL_TRUE;
+ return CONTROL_FALSE;
+ }
+@@ -88,8 +89,10 @@
+ if (!context)
+ goto err_out;
+
+- theora_info_init(&context->inf);
+- theora_comment_init(&context->cc);
++ th_info_init(&context->ti);
++ th_comment_init(&context->tc);
++ context->tsi = NULL;
++
+
+ /* Read all header packets, pass them to theora_decode_header. */
+ for (i = 0; i < THEORA_NUM_HEADER_PACKETS; i++)
+@@ -109,7 +112,7 @@
+ op.b_o_s = 1;
+ }
+
+- if ( (errorCode = theora_decode_header (&context->inf, &context->cc, &op)) )
++ if ( (errorCode = th_decode_headerin (&context->ti, &context->tc, &context->tsi, &op)) < 0)
+ {
+ mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Broken Theora header; errorCode=%i!\n", errorCode);
+ goto err_out;
+@@ -117,23 +120,25 @@
+ }
+
+ /* now init codec */
+- errorCode = theora_decode_init (&context->st, &context->inf);
+- if (errorCode)
++ context->tctx = th_decode_alloc (&context->ti, &context->tsi);
++ if (!context->tctx)
+ {
+- mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Theora decode init failed: %i \n", errorCode);
++ mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Theora decode init failed\n");
+ goto err_out;
+ }
++ /* free memory used for decoder setup information */
++ th_setup_free(context->tsi);
+
+- if(sh->aspect==0.0 && context->inf.aspect_denominator!=0)
++ if(sh->aspect==0.0 && context->ti.aspect_denominator!=0)
+ {
+- sh->aspect = ((double)context->inf.aspect_numerator * context->inf.width)/
+- ((double)context->inf.aspect_denominator * context->inf.height);
++ sh->aspect = ((double)context->ti.aspect_numerator * context->ti.frame_width)/
++ ((double)context->ti.aspect_denominator * context->ti.frame_height);
+ }
+
+ mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Theora video init ok!\n");
+- mp_msg(MSGT_DECVIDEO,MSGL_INFO,"Frame: %dx%d, Picture %dx%d, Offset [%d,%d]\n", context->inf.width, context->inf.height, context->inf.frame_width, context->inf.frame_height, context->inf.offset_x, context->inf.offset_y);
++ mp_msg(MSGT_DECVIDEO,MSGL_INFO,"Frame: %dx%d, Picture %dx%d, Offset [%d,%d]\n", context->ti.frame_width, context->ti.frame_height, context->ti.pic_width, context->ti.pic_height, context->ti.pic_x, context->ti.pic_y);
+
+- return mpcodecs_config_vo (sh,context->inf.width,context->inf.height,theora_pixelformat2imgfmt(context->inf.pixelformat));
++ return mpcodecs_config_vo (sh,context->ti.frame_width,context->ti.frame_height,theora_pixelformat2imgfmt(context->ti.pixel_fmt));
+
+ err_out:
+ free(context);
+@@ -150,9 +155,9 @@
+
+ if (context)
+ {
+- theora_info_clear(&context->inf);
+- theora_comment_clear(&context->cc);
+- theora_clear (&context->st);
++ th_info_clear(&context->ti);
++ th_comment_clear(&context->tc);
++ th_decode_free (context->tctx);
+ free (context);
+ }
+ }
+@@ -165,7 +170,7 @@
+ theora_struct_t *context = sh->context;
+ int errorCode = 0;
+ ogg_packet op;
+- yuv_buffer yuv;
++ th_ycbcr_buffer ycbcrbuf;
+ mp_image_t* mpi;
+
+ // no delayed frames
+@@ -177,31 +182,31 @@
+ op.packet = data;
+ op.granulepos = -1;
+
+- errorCode = theora_decode_packetin (&context->st, &op);
+- if (errorCode)
++ errorCode = th_decode_packetin (context->tctx, &op, NULL);
++ if (errorCode < 0)
+ {
+ mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Theora decode packetin failed: %i \n",
+ errorCode);
+ return NULL;
+ }
+
+- errorCode = theora_decode_YUVout (&context->st, &yuv);
+- if (errorCode)
++ errorCode = th_decode_ycbcr_out (context->tctx, ycbcrbuf);
++ if (errorCode < 0)
+ {
+ mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Theora decode YUVout failed: %i \n",
+ errorCode);
+ return NULL;
+ }
+
+- mpi = mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, 0, yuv.y_width, yuv.y_height);
++ mpi = mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, 0, ycbcrbuf[0].width, ycbcrbuf[0].height);
+ if(!mpi) return NULL;
+
+- mpi->planes[0]=yuv.y;
+- mpi->stride[0]=yuv.y_stride;
+- mpi->planes[1]=yuv.u;
+- mpi->stride[1]=yuv.uv_stride;
+- mpi->planes[2]=yuv.v;
+- mpi->stride[2]=yuv.uv_stride;
++ mpi->planes[0]=ycbcrbuf[0].data;
++ mpi->stride[0]=ycbcrbuf[0].stride;
++ mpi->planes[1]=ycbcrbuf[1].data;
++ mpi->stride[1]=ycbcrbuf[1].stride;
++ mpi->planes[2]=ycbcrbuf[2].data;
++ mpi->stride[2]=ycbcrbuf[2].stride;
+
+ return mpi;
+ }
+--- libmpdemux/demux_ogg.c.orig 2013-07-09 18:33:16.000000000 +0200
++++ libmpdemux/demux_ogg.c 2015-03-25 01:47:19.439377000 +0100
+@@ -50,21 +50,21 @@
+ #endif
+
+ #ifdef CONFIG_OGGTHEORA
+-#include <theora/theora.h>
+-int _ilog (unsigned int); /* defined in many places in theora/lib/ */
++#include <theora/theoradec.h>
+ #endif
+
+ #define BLOCK_SIZE 4096
+
+ /* Theora decoder context : we won't be able to interpret granule positions
+- * without using theora_granule_time with the theora_state of the stream.
++ * without using th_granule_time with the th_dec_ctx of the stream.
+ * This is duplicated in `vd_theora.c'; put this in a common header?
+ */
+ #ifdef CONFIG_OGGTHEORA
+ typedef struct theora_struct_st {
+- theora_state st;
+- theora_comment cc;
+- theora_info inf;
++ th_setup_info *tsi;
++ th_dec_ctx *tctx;
++ th_comment tc;
++ th_info ti;
+ } theora_struct_t;
+ #endif
+
+@@ -117,7 +117,7 @@
+ float samplerate; /// granulpos 2 time
+ int64_t lastpos;
+ int32_t lastsize;
+- int keyframe_frequency_force;
++ int keyframe_granule_shift;
+
+ // Logical stream state
+ ogg_stream_state stream;
+@@ -300,11 +300,10 @@
+ have theora_state st, until all header packets were passed to the
+ decoder. */
+ if (!pack->bytes || !(*data&0x80)) {
+- int keyframe_granule_shift = _ilog(os->keyframe_frequency_force - 1);
+- int64_t iframemask = (1 << keyframe_granule_shift) - 1;
++ int64_t iframemask = (1 << os->keyframe_granule_shift) - 1;
+
+ if (pack->granulepos >= 0) {
+- os->lastpos = pack->granulepos >> keyframe_granule_shift;
++ os->lastpos = pack->granulepos >> os->keyframe_granule_shift;
+ os->lastpos += pack->granulepos & iframemask;
+ *keyframe = (pack->granulepos & iframemask) == 0;
+ } else {
+@@ -888,14 +887,15 @@
+ #ifdef CONFIG_OGGTHEORA
+ } else if (pack.bytes >= 7 && !strncmp (&pack.packet[1], "theora", 6)) {
+ int errorCode = 0;
+- theora_info inf;
+- theora_comment cc;
++ th_info ti;
++ th_comment tc;
++ th_setup_info *tsi = NULL;
+
+- theora_info_init (&inf);
+- theora_comment_init (&cc);
++ th_info_init (&ti);
++ th_comment_init (&tc);
+
+- errorCode = theora_decode_header (&inf, &cc, &pack);
+- if (errorCode) {
++ errorCode = th_decode_headerin (&ti, &tc, &tsi, &pack);
++ if (errorCode < 0) {
+ mp_msg(MSGT_DEMUX, MSGL_ERR,
+ "Theora header parsing failed: %i \n", errorCode);
+ } else {
+@@ -904,30 +904,32 @@
+ sh_v->bih = calloc(1, sizeof(*sh_v->bih));
+ sh_v->bih->biSize = sizeof(*sh_v->bih);
+ sh_v->bih->biCompression = sh_v->format = FOURCC_THEORA;
+- sh_v->fps = ((double)inf.fps_numerator) / (double)inf.fps_denominator;
+- sh_v->frametime = ((double)inf.fps_denominator) / (double)inf.fps_numerator;
+- sh_v->disp_w = sh_v->bih->biWidth = inf.frame_width;
+- sh_v->disp_h = sh_v->bih->biHeight = inf.frame_height;
++ sh_v->fps = ((double)ti.fps_numerator) / (double)ti.fps_denominator;
++ sh_v->frametime = ((double)ti.fps_denominator) / (double)ti.fps_numerator;
++ sh_v->i_bps = ti.target_bitrate / 8;
++ sh_v->disp_w = sh_v->bih->biWidth = ti.frame_width;
++ sh_v->disp_h = sh_v->bih->biHeight = ti.frame_height;
+ sh_v->bih->biBitCount = 24;
+ sh_v->bih->biPlanes = 3;
+ sh_v->bih->biSizeImage = ((sh_v->bih->biBitCount / 8) * sh_v->bih->biWidth * sh_v->bih->biHeight);
+ ogg_d->subs[ogg_d->num_sub].samplerate = sh_v->fps;
+ ogg_d->subs[ogg_d->num_sub].theora = 1;
+- ogg_d->subs[ogg_d->num_sub].keyframe_frequency_force = inf.keyframe_frequency_force;
++ ogg_d->subs[ogg_d->num_sub].keyframe_granule_shift = ti.keyframe_granule_shift;
+ ogg_d->subs[ogg_d->num_sub].id = n_video;
+ n_video++;
+ mp_msg(MSGT_DEMUX, MSGL_INFO,
+ "[Ogg] stream %d: video (Theora v%d.%d.%d), -vid %d\n",
+ ogg_d->num_sub,
+- (int)inf.version_major,
+- (int)inf.version_minor,
+- (int)inf.version_subminor,
++ (int)ti.version_major,
++ (int)ti.version_minor,
++ (int)ti.version_subminor,
+ n_video - 1);
+ if (mp_msg_test(MSGT_HEADER, MSGL_V))
+ print_video_header(sh_v->bih, MSGL_V);
+ }
+- theora_comment_clear(&cc);
+- theora_info_clear(&inf);
++ th_comment_clear(&tc);
++ th_info_clear(&ti);
++ th_setup_free(tsi);
+ #endif /* CONFIG_OGGTHEORA */
+ } else if (pack.bytes >= 4 && !strncmp (&pack.packet[0], "fLaC", 4)) {
+ sh_a = new_sh_audio_aid(demuxer, ogg_d->num_sub, n_audio);
diff --git a/vo_gl_locale_fix.patch b/vo_gl_locale_fix.patch
new file mode 100644
index 000000000000..9489b4ea7633
--- /dev/null
+++ b/vo_gl_locale_fix.patch
@@ -0,0 +1,26 @@
+The generated output may use something other than "." for decimal
+point, which GLSL requires. This is caused by locale. C uses ".",
+so locale is temporaily set to "C" when sprinting floats.
+diff -Naur mplayer2.old/libvo/gl_common.c mplayer2/libvo/gl_common.c
+--- mplayer2.old/libvo/gl_common.c 2014-02-24 21:57:13.493418840 +0100
++++ mplayer2/libvo/gl_common.c 2014-02-24 22:00:25.136048921 +0100
+@@ -39,6 +39,7 @@
+ #include <ctype.h>
+ #include <stdbool.h>
+ #include <math.h>
++#include <locale.h>
+ #include "talloc.h"
+ #include "gl_common.h"
+ #include "old_vo_wrapper.h"
+@@ -823,7 +824,10 @@
+
+ static void replace_var_float(char **text, const char *name, float replace)
+ {
++ char *tmp = setlocale(LC_NUMERIC, NULL);
++ setlocale(LC_NUMERIC, "C");
+ char *s = talloc_asprintf(NULL, "%e", replace);
++ setlocale(LC_NUMERIC, tmp);
+ replace_var_str(text, name, s);
+ talloc_free(s);
+ }
+