mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-03-19 00:21:40 +00:00
community/mpv to 0.27.0-4
This commit is contained in:
parent
c623503b9f
commit
1d86de1e16
3 changed files with 128 additions and 1 deletions
91
community/mpv/0002-vaapi-Use-libva2-message-callbacks.patch
Normal file
91
community/mpv/0002-vaapi-Use-libva2-message-callbacks.patch
Normal file
|
@ -0,0 +1,91 @@
|
|||
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: 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);
|
||||
}
|
||||
--
|
||||
cgit v1.1-22-g1649
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
From e9dc4ac86f9dbd59147963d08ec8447bba3ed0bb Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Kucera <daniel.kucera@gmail.com>
|
||||
Date: Mon, 23 Oct 2017 15:29:17 +0200
|
||||
Subject: [PATCH] demux_lavf: return AVERROR_EOF on file end
|
||||
|
||||
Signed-off-by: Daniel Kucera <daniel.kucera@gmail.com>
|
||||
Signed-off-by: wm4 <wm4@nowhere>
|
||||
|
||||
Uses different style and different logic from original PR.
|
||||
---
|
||||
demux/demux_lavf.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
|
||||
index c11f7739e1..11fa1c59b6 100644
|
||||
--- a/demux/demux_lavf.c
|
||||
+++ b/demux/demux_lavf.c
|
||||
@@ -242,7 +242,7 @@ static int mp_read(void *opaque, uint8_t *buf, int size)
|
||||
|
||||
MP_TRACE(demuxer, "%d=mp_read(%p, %p, %d), pos: %"PRId64", eof:%d\n",
|
||||
ret, stream, buf, size, stream_tell(stream), stream->eof);
|
||||
- return ret;
|
||||
+ return ret ? ret : AVERROR_EOF;
|
||||
}
|
||||
|
||||
static int64_t mp_seek(void *opaque, int64_t pos, int whence)
|
|
@ -9,7 +9,7 @@
|
|||
pkgname=mpv
|
||||
epoch=1
|
||||
pkgver=0.27.0
|
||||
pkgrel=2
|
||||
pkgrel=4
|
||||
_waf_version=1.8.12
|
||||
pkgdesc='a free, open source, and cross-platform media player'
|
||||
arch=('i686' 'x86_64')
|
||||
|
@ -26,9 +26,13 @@ optdepends=('youtube-dl: for video-sharing websites playback')
|
|||
options=('!emptydirs')
|
||||
source=("$pkgname-$pkgver.tar.gz::https://github.com/mpv-player/$pkgname/archive/v$pkgver.tar.gz"
|
||||
'0001-opengl-backend-support-multiple-backends.patch'
|
||||
'0002-vaapi-Use-libva2-message-callbacks.patch'
|
||||
'0003-demux_lavf-return-AVERROR_EOF-on-file-end.patch'
|
||||
"http://www.freehackers.org/~tnagy/release/waf-${_waf_version}")
|
||||
sha256sums=('341d8bf18b75c1f78d5b681480b5b7f5c8b87d97a0d4f53a5648ede9c219a49c'
|
||||
'609e0530f1b0cdb910dcffb5f62bf55936540e24105ce1b2daf1bd6291a7d58a'
|
||||
'3c3517f4f4c71e39e1e04ea440688fc8d7b3dc55e6bc0a9398d11a9b75bde07d'
|
||||
'5de6c616428c87cf9b39d8ba24446d65d175050c083e1054194d93cf03d5816a'
|
||||
'01bf2beab2106d1558800c8709bc2c8e496d3da4a2ca343fe091f22fca60c98b')
|
||||
|
||||
prepare() {
|
||||
|
@ -37,6 +41,12 @@ prepare() {
|
|||
# --opengl-backend: support multiple backends (#4384) (FS#53962)
|
||||
patch -Np1 < "${srcdir}"/0001-opengl-backend-support-multiple-backends.patch
|
||||
|
||||
# vaapi: Use libva2 message callbacks
|
||||
patch -Np1 < "${srcdir}"/0002-vaapi-Use-libva2-message-callbacks.patch
|
||||
|
||||
# demux_lavf: return AVERROR_EOF on file end
|
||||
patch -Np1 < "${srcdir}"/0003-demux_lavf-return-AVERROR_EOF-on-file-end.patch
|
||||
|
||||
install -m755 "${srcdir}"/waf-${_waf_version} waf
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue