[Android] jni: fix aout args

Thomas Guillem git at videolan.org
Wed Dec 3 10:46:08 CET 2014


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Dec  2 11:49:54 2014 +0100| [a8249c2349e662dd2f5fc367c985e1855e364ccd] | committer: Thomas Guillem

jni: fix aout args

Don't try to load any audio module for AOUT_AUDIOTRACK_JAVA.
The good module (amem) will be loaded when callbacks are set.

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

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

diff --git a/libvlc/jni/libvlcjni.c b/libvlc/jni/libvlcjni.c
index b2c0cce..94b216c 100644
--- a/libvlc/jni/libvlcjni.c
+++ b/libvlc/jni/libvlcjni.c
@@ -262,7 +262,7 @@ void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz)
     //only use OpenSLES if java side says we can
     jclass cls = (*env)->GetObjectClass(env, thiz);
     jmethodID methodId = (*env)->GetMethodID(env, cls, "getAout", "()I");
-    bool use_opensles = (*env)->CallIntMethod(env, thiz, methodId) == AOUT_OPENSLES;
+    int aout = (*env)->CallIntMethod(env, thiz, methodId);
 
     methodId = (*env)->GetMethodID(env, cls, "getVout", "()I");
     int vout = (*env)->CallIntMethod(env, thiz, methodId);
@@ -338,7 +338,8 @@ void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz)
         (networkCaching > 0) ? networkCachingstr : "",
 
         /* Android audio API is a mess */
-        use_opensles ? "--aout=opensles" : "--aout=android_audiotrack",
+        aout == AOUT_OPENSLES ? "--aout=opensles" :
+            (aout == AOUT_AUDIOTRACK ? "--aout=android_audiotrack" : "--aout=dummy"),
 
         /* Android video API is a mess */
         vout == VOUT_ANDROID_WINDOW ? "--vout=androidwindow" :



More information about the Android mailing list