[Android] Fix verbosity setting
Rafaël Carré
git at videolan.org
Sat Jun 23 12:39:03 CEST 2012
android | branch: master | Rafaël Carré <funman at videolan.org> | Sat Jun 23 12:38:52 2012 +0200| [e3a262aa8ad8fc96cbd7ab29df1b73e464c94113] | committer: Rafaël Carré
Fix verbosity setting
> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=e3a262aa8ad8fc96cbd7ab29df1b73e464c94113
---
vlc-android/jni/libvlcjni.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/vlc-android/jni/libvlcjni.c b/vlc-android/jni/libvlcjni.c
index 59e5cd1..88177d6 100644
--- a/vlc-android/jni/libvlcjni.c
+++ b/vlc-android/jni/libvlcjni.c
@@ -242,7 +242,7 @@ void Java_org_videolan_vlc_LibVLC_detachSurface(JNIEnv *env, jobject thiz) {
static void debug_log(void *data, int level, const char *fmt, va_list ap)
{
- bool *verbose = (bool*)data;
+ bool *verbose = data;
static const uint8_t priority[5] = {
[LIBVLC_DEBUG] = ANDROID_LOG_DEBUG,
@@ -263,11 +263,13 @@ static void debug_log(void *data, int level, const char *fmt, va_list ap)
}
static libvlc_log_subscriber_t debug_subscriber;
+static bool verbosity;
void Java_org_videolan_vlc_LibVLC_changeVerbosity(JNIEnv *env, jobject thiz, jboolean verbose)
{
+ verbosity = verbose;
libvlc_log_unsubscribe(&debug_subscriber);
- libvlc_log_subscribe(&debug_subscriber, debug_log, &verbose);
+ libvlc_log_subscribe(&debug_subscriber, debug_log, &verbosity);
}
void Java_org_videolan_vlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz, jboolean verbose)
@@ -277,7 +279,8 @@ void Java_org_videolan_vlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz, jboolean
jmethodID methodId = (*env)->GetMethodID(env, cls, "getAout", "()I");
bool use_opensles = (*env)->CallIntMethod(env, thiz, methodId) == AOUT_OPENSLES;
- libvlc_log_subscribe(&debug_subscriber, debug_log, &verbose);
+ verbosity = verbose;
+ libvlc_log_subscribe(&debug_subscriber, debug_log, &verbosity);
/* Don't add any invalid options, otherwise it causes LibVLC to crash */
const char *argv[] = {
More information about the Android
mailing list