[vlc-commits] logger/android: use "verbose" var

Thomas Guillem git at videolan.org
Tue Feb 10 15:16:01 CET 2015


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Feb 10 14:25:36 2015 +0100| [39bd1d86395da4fd6c85d9754904846459266e1c] | committer: Jean-Baptiste Kempf

logger/android: use "verbose" var

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=39bd1d86395da4fd6c85d9754904846459266e1c
---

 modules/logger/android.c |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/modules/logger/android.c b/modules/logger/android.c
index f8369ff..a89eb86 100644
--- a/modules/logger/android.c
+++ b/modules/logger/android.c
@@ -36,11 +36,15 @@
 
 static const int ptr_width = 2 * /* hex digits */ sizeof (uintptr_t);
 
-static void AndroidPrintMsg(void *d, int type, const vlc_log_t *p_item,
+static void AndroidPrintMsg(void *opaque, int type, const vlc_log_t *p_item,
                             const char *format, va_list ap)
 {
     int prio;
     char *format2;
+    int verbose = (intptr_t)opaque;
+
+    if (verbose < type)
+        return;
 
     int canc = vlc_savecancel();
 
@@ -69,8 +73,12 @@ static void AndroidPrintMsg(void *d, int type, const vlc_log_t *p_item,
 
 static vlc_log_cb Open(vlc_object_t *obj, void **sysp)
 {
-    VLC_UNUSED(obj);
-    VLC_UNUSED(sysp);
+    int verbosity = var_InheritInteger(obj, "verbose");
+
+    if (verbosity < 0)
+        return NULL;
+
+    *sysp = (void *)(uintptr_t)verbosity;
 
     return AndroidPrintMsg;
 }



More information about the vlc-commits mailing list