[Android] set libvlc verbosity according to settings

Thomas Guillem git at videolan.org
Tue Feb 10 14:23:51 CET 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Feb 10 14:23:12 2015 +0100| [9299cd6f678682e261486a4f566cac775fed8949] | committer: Thomas Guillem

set libvlc verbosity according to settings

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=9299cd6f678682e261486a4f566cac775fed8949
---

 libvlc/jni/libvlcjni.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/libvlc/jni/libvlcjni.c b/libvlc/jni/libvlcjni.c
index b02ca39..52ff726 100644
--- a/libvlc/jni/libvlcjni.c
+++ b/libvlc/jni/libvlcjni.c
@@ -347,9 +347,6 @@ int jni_get_env(JNIEnv **env)
     return (*myVm)->GetEnv(myVm, (void **)env, VLC_JNI_VERSION) == JNI_OK ? 0 : -1;
 }
 
-// FIXME: use atomics
-static bool verbosity;
-
 void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz)
 {
     //only use OpenSLES if java side says we can
@@ -394,7 +391,7 @@ void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz)
     LOGD("Subtitle encoding set to \"%s\"", subsencodingstr);
 
     methodId = (*env)->GetMethodID(env, cls, "isVerboseMode", "()Z");
-    verbosity = (*env)->CallBooleanMethod(env, thiz, methodId);
+    bool b_verbose = (*env)->CallBooleanMethod(env, thiz, methodId);
 
     methodId = (*env)->GetMethodID(env, cls, "isDirectRendering", "()Z");
     bool direct_rendering = (*env)->CallBooleanMethod(env, thiz, methodId);
@@ -410,7 +407,7 @@ void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz)
         (*env)->ReleaseStringUTFChars(env, cachePath, cache_path);
     }
 
-#define MAX_ARGV 18
+#define MAX_ARGV 19
     const char *argv[MAX_ARGV];
     int argc = 0;
 
@@ -449,6 +446,8 @@ void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz)
         argv[argc++] = "--no-omxil-dr";
 #endif
     }
+    argv[argc++] = b_verbose ? "-vvv" : "-vv";
+
     /* Reconnect on lost HTTP streams, e.g. network change */
     if (enable_http_reconnect)
         argv[argc++] = "--http-reconnect";



More information about the Android mailing list