mpv: build with --disable-android

Since 0.28 the android build option is used for a few features that
are not useful in Termux (as we don't do video output and JNI isn't
available)

In 0.27 the option is only used to enable some wrapping of strnlen,
as it was broken (but also fixed) long time ago in Android.

Therefore instead of the extra patching that do us no good, let us
simply build with --disable-android and disable the wrapping.

Also use vid=no instead of vo=null in mpv.conf, as the latter does
not prevent video decoding.
This commit is contained in:
Tom Yan 2018-06-26 15:37:17 +08:00 committed by Fredrik Fornwall
parent 6b1e98dff5
commit d91df72f7f
6 changed files with 21 additions and 51 deletions

View File

@ -1,6 +1,7 @@
TERMUX_PKG_HOMEPAGE=https://mpv.io/
TERMUX_PKG_DESCRIPTION="Command-line media player"
TERMUX_PKG_VERSION=0.28.2
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=aada14e025317b5b3e8e58ffaf7902e8b6e4ec347a93d25a7c10d3579426d795
TERMUX_PKG_SRCURL=https://github.com/mpv-player/mpv/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_DEPENDS="ffmpeg, openal-soft, libandroid-glob"
@ -27,7 +28,8 @@ termux_step_make_install () {
--enable-openal \
--disable-caca \
--disable-alsa \
--disable-x11
--disable-x11 \
--disable-android
./waf -v install

View File

@ -6,5 +6,5 @@ ao=opensles
# Increase audio buffer to help with stuttering with bluetooth devices. See #1127.
audio-buffer=0.5
# Disable Video Output. Termux doesn't support video output (with the exception of "tct").
vo=null
# Disable Video Decode and Output. Termux doesn't support video output (with the exception of "tct").
vid=no

View File

@ -0,0 +1,16 @@
diff --git a/osdep/strnlen.h b/osdep/strnlen.h
index 0a971d0ab0..9a8b2a104d 100644
--- a/osdep/strnlen.h
+++ b/osdep/strnlen.h
@@ -19,11 +19,4 @@
#ifndef MP_OSDEP_STRNLEN
#define MP_OSDEP_STRNLEN
-
-#ifdef __ANDROID__
-// strnlen is broken on current android ndk, see https://code.google.com/p/android/issues/detail?id=74741
-#include "osdep/android/strnlen.h"
-#define strnlen freebsd_strnlen
-#endif
-
#endif

View File

@ -1,13 +0,0 @@
diff -u -r ../mpv-0.28.2/video/out/gpu/context.c ./video/out/gpu/context.c
--- ../mpv-0.28.2/video/out/gpu/context.c 2018-02-13 02:07:05.000000000 +0000
+++ ./video/out/gpu/context.c 2018-06-24 00:34:19.827691478 +0000
@@ -63,7 +63,9 @@
// OpenGL contexts:
#if HAVE_ANDROID
+# if HAVE_GL
&ra_ctx_android,
+# endif
#endif
#if HAVE_RPI
&ra_ctx_rpi,

View File

@ -1,23 +0,0 @@
diff -u -r ../mpv-0.28.2/wscript ./wscript
--- ../mpv-0.28.2/wscript 2018-02-13 03:07:05.000000000 +0100
+++ ./wscript 2018-06-25 14:48:26.288156610 +0200
@@ -154,9 +154,7 @@
'name': '--android',
'desc': 'Android environment',
'func': compose_checks(
- check_statement('android/api-level.h', '(void)__ANDROID__'), # arbitrary android-specific header
- check_cc(lib="android"),
- check_cc(lib="EGL"),
+ check_statement('android/api-level.h', '(void)__ANDROID__') # arbitrary android-specific header
)
}, {
'name': 'posix-or-mingw',
@@ -813,7 +811,7 @@
'name': 'egl-helpers',
'desc': 'EGL helper functions',
'deps': 'egl-x11 || mali-fbdev || rpi || gl-wayland || egl-drm || ' +
- 'egl-angle-win32 || android',
+ 'egl-angle-win32',
'func': check_true
}
]

View File

@ -1,12 +0,0 @@
diff -u -r ../mpv-0.28.2/wscript_build.py ./wscript_build.py
--- ../mpv-0.28.2/wscript_build.py 2018-02-13 02:07:05.000000000 +0000
+++ ./wscript_build.py 2018-06-24 00:28:49.967625363 +0000
@@ -409,7 +409,7 @@
( "video/out/opengl/context_drm_egl.c", "egl-drm" ),
( "video/out/opengl/context_dxinterop.c","gl-dxinterop" ),
( "video/out/opengl/context_mali_fbdev.c","mali-fbdev" ),
- ( "video/out/opengl/context_android.c", "android" ),
+ ( "video/out/opengl/context_android.c", "android && gl" ),
( "video/out/opengl/context_rpi.c", "rpi" ),
( "video/out/opengl/context_vdpau.c", "vdpau-gl-x11" ),
( "video/out/opengl/context_wayland.c", "gl-wayland" ),