aboutsummaryrefslogtreecommitdiffstats
path: root/community/mpv
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-12-19 11:07:56 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2017-12-19 14:10:31 +0000
commite413d2916489d5991317574cb2060edb1a6d5c23 (patch)
tree3e4ebd7ab58b296dea8f4fec3cea119dad11ffea /community/mpv
parent19d8ccb2e36ed95fd900f07e5f062a08d2d4bfc6 (diff)
downloadaports-e413d2916489d5991317574cb2060edb1a6d5c23.tar.bz2
aports-e413d2916489d5991317574cb2060edb1a6d5c23.tar.xz
community/mpv: rebuild against libva2
Diffstat (limited to 'community/mpv')
-rw-r--r--community/mpv/APKBUILD8
-rw-r--r--community/mpv/fix-libva2.patch88
2 files changed, 93 insertions, 3 deletions
diff --git a/community/mpv/APKBUILD b/community/mpv/APKBUILD
index 94bc516127..81f8f8e990 100644
--- a/community/mpv/APKBUILD
+++ b/community/mpv/APKBUILD
@@ -5,7 +5,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mpv
pkgver=0.27.0
-pkgrel=1
+pkgrel=2
pkgdesc="Video player based on MPlayer/mplayer2"
url="https://mpv.io/"
arch="all"
@@ -20,7 +20,8 @@ subpackages="
$pkgname-doc
$pkgname-libs
$pkgname-zsh-completion:zshcomp:noarch"
-source="$pkgname-$pkgver.tar.gz::https://github.com/mpv-player/$pkgname/archive/v$pkgver.tar.gz"
+source="$pkgname-$pkgver.tar.gz::https://github.com/mpv-player/$pkgname/archive/v$pkgver.tar.gz
+ fix-libva2.patch"
builddir="$srcdir/$pkgname-$pkgver"
prepare() {
@@ -67,4 +68,5 @@ zshcomp() {
"$subpkgdir/usr/share/zsh/site-functions" || return 1
}
-sha512sums="22738f907d84d362095773972f685e3b03ab4c8172a22ddede290fc221a83ab9135b96f8b18191dabe842b2963f68983929cf065097287fc1a054a7d5f1d0ae4 mpv-0.27.0.tar.gz"
+sha512sums="22738f907d84d362095773972f685e3b03ab4c8172a22ddede290fc221a83ab9135b96f8b18191dabe842b2963f68983929cf065097287fc1a054a7d5f1d0ae4 mpv-0.27.0.tar.gz
+43e89cf7e939cc30c4a70172f06d652005a251350dfc9335d51dde981f177b656bf3cf8f3eaa1a2b19fc563e9a09f6e32843eff2105fab7e3d9e10f3b2245f84 fix-libva2.patch"
diff --git a/community/mpv/fix-libva2.patch b/community/mpv/fix-libva2.patch
new file mode 100644
index 0000000000..843e844945
--- /dev/null
+++ b/community/mpv/fix-libva2.patch
@@ -0,0 +1,88 @@
+From 2ecf240b1cd20875991a5b18efafbe799864ff7f Mon Sep 17 00:00:00 2001
+From: Mark Thompson <sw@jkqxz.net>
+Date: Mon, 9 Oct 2017 20:10:26 +0100
+Subject: [PATCH] vaapi: Use libva2 message callbacks
+
+They are no longer global, so they work vaguely sensibly.
+---
+ video/vaapi.c | 32 +++++++++++++++++++++++++++++---
+ 1 file changed, 29 insertions(+), 3 deletions(-)
+
+diff --git a/video/vaapi.c b/video/vaapi.c
+index 6bedbbaa18..3b1cb9cc41 100644
+--- a/video/vaapi.c
++++ b/video/vaapi.c
+@@ -40,9 +40,27 @@ int va_get_colorspace_flag(enum mp_csp csp)
+ return 0;
+ }
+
+-// VA message callbacks are global and do not have a context parameter, so it's
+-// impossible to know from which VADisplay they originate. Try to route them
+-// to existing mpv/libmpv instances within this process.
++#if VA_CHECK_VERSION(1, 0, 0)
++static void va_message_callback(void *context, const char *msg, int mp_level)
++{
++ struct mp_vaapi_ctx *res = context;
++ mp_msg(res->log, mp_level, "libva: %s", msg);
++}
++
++static void va_error_callback(void *context, const char *msg)
++{
++ va_message_callback(context, msg, MSGL_ERR);
++}
++
++static void va_info_callback(void *context, const char *msg)
++{
++ va_message_callback(context, msg, MSGL_V);
++}
++#else
++// Pre-libva2 VA message callbacks are global and do not have a context
++// parameter, so it's impossible to know from which VADisplay they
++// originate. Try to route them to existing mpv/libmpv instances within
++// this process.
+ static pthread_mutex_t va_log_mutex = PTHREAD_MUTEX_INITIALIZER;
+ static struct mp_vaapi_ctx **va_mpv_clients;
+ static int num_va_mpv_clients;
+@@ -77,6 +95,7 @@ static void va_info_callback(const char *msg)
+ {
+ va_message_callback(msg, MSGL_V);
+ }
++#endif
+
+ static void open_lavu_vaapi_device(struct mp_vaapi_ctx *ctx)
+ {
+@@ -108,6 +127,10 @@ struct mp_vaapi_ctx *va_initialize(VADisplay *display, struct mp_log *plog,
+ },
+ };
+
++#if VA_CHECK_VERSION(1, 0, 0)
++ vaSetErrorCallback(display, va_error_callback, res);
++ vaSetInfoCallback(display, va_info_callback, res);
++#else
+ pthread_mutex_lock(&va_log_mutex);
+ MP_TARRAY_APPEND(NULL, va_mpv_clients, num_va_mpv_clients, res);
+ pthread_mutex_unlock(&va_log_mutex);
+@@ -117,6 +140,7 @@ struct mp_vaapi_ctx *va_initialize(VADisplay *display, struct mp_log *plog,
+ #ifdef VA_FOURCC_I010
+ vaSetErrorCallback(va_error_callback);
+ vaSetInfoCallback(va_info_callback);
++#endif
+ #endif
+
+ int major, minor;
+@@ -154,6 +178,7 @@ void va_destroy(struct mp_vaapi_ctx *ctx)
+ if (ctx->destroy_native_ctx)
+ ctx->destroy_native_ctx(ctx->native_ctx);
+
++#if !VA_CHECK_VERSION(1, 0, 0)
+ pthread_mutex_lock(&va_log_mutex);
+ for (int n = 0; n < num_va_mpv_clients; n++) {
+ if (va_mpv_clients[n] == ctx) {
+@@ -164,6 +189,7 @@ void va_destroy(struct mp_vaapi_ctx *ctx)
+ if (num_va_mpv_clients == 0)
+ TA_FREEP(&va_mpv_clients); // avoid triggering leak detectors
+ pthread_mutex_unlock(&va_log_mutex);
++#endif
+
+ talloc_free(ctx);
+ }