[vlc-devel] [RFC PATCH 2/2] android: replace hardcoded JNI_VERSION_1_2 by VLC_JNI_VERSION
Zhao Zhili
quinkblack at foxmail.com
Thu Aug 2 08:20:38 CEST 2018
---
modules/video_output/android/utils.c | 4 ++--
src/android/specific.c | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/modules/video_output/android/utils.c b/modules/video_output/android/utils.c
index de65746..dc75e63 100644
--- a/modules/video_output/android/utils.c
+++ b/modules/video_output/android/utils.c
@@ -342,12 +342,12 @@ android_getEnvCommon(vlc_object_t *p_obj, JavaVM *jvm, const char *psz_name)
/* if GetEnv returns JNI_OK, the thread is already attached to the
* JavaVM, so we are already in a java thread, and we don't have to
* setup any destroy callbacks */
- if ((*jvm)->GetEnv(jvm, (void **)&env, JNI_VERSION_1_2) != JNI_OK)
+ if ((*jvm)->GetEnv(jvm, (void **)&env, VLC_JNI_VERSION) != JNI_OK)
{
/* attach the thread to the Java VM */
JavaVMAttachArgs args;
- args.version = JNI_VERSION_1_2;
+ args.version = VLC_JNI_VERSION;
args.name = psz_name;
args.group = NULL;
diff --git a/src/android/specific.c b/src/android/specific.c
index c75b5e2..2a37e94 100644
--- a/src/android/specific.c
+++ b/src/android/specific.c
@@ -84,7 +84,7 @@ JNI_OnUnload(JavaVM* vm, void* reserved)
free(ppsz_generic_names[i]);
JNIEnv* env = NULL;
- if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_2) != JNI_OK)
+ if ((*vm)->GetEnv(vm, (void**) &env, VLC_JNI_VERSION) != JNI_OK)
return;
if (fields.Environment.clazz)
@@ -103,7 +103,7 @@ JNI_OnLoad(JavaVM *vm, void *reserved)
s_jvm = vm;
JNIEnv* env = NULL;
- if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_2) != JNI_OK)
+ if ((*vm)->GetEnv(vm, (void**) &env, VLC_JNI_VERSION) != JNI_OK)
return -1;
jclass clazz = (*env)->FindClass(env, "android/os/Environment");
@@ -153,7 +153,7 @@ JNI_OnLoad(JavaVM *vm, void *reserved)
"(Ljava/lang/String;)Ljava/lang/String;");
(*env)->DeleteLocalRef(env, clazz);
- return JNI_VERSION_1_2;
+ return VLC_JNI_VERSION;
error:
if (clazz)
@@ -202,12 +202,12 @@ fallback:
static JNIEnv *get_env(bool *p_detach)
{
JNIEnv *env;
- if ((*s_jvm)->GetEnv(s_jvm, (void **)&env, JNI_VERSION_1_2) != JNI_OK)
+ if ((*s_jvm)->GetEnv(s_jvm, (void **)&env, VLC_JNI_VERSION) != JNI_OK)
{
/* attach the thread to the Java VM */
JavaVMAttachArgs args;
- args.version = JNI_VERSION_1_2;
+ args.version = VLC_JNI_VERSION;
args.name = "config_GetGenericDir";
args.group = NULL;
--
2.9.5
More information about the vlc-devel
mailing list