[Android] libvlc: remove nativeReadDirectory

Jean-Baptiste Kempf git at videolan.org
Thu May 28 14:56:05 CEST 2015


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu May 28 14:55:50 2015 +0200| [43b2cf970d6622c653fd674556aa6013868b73e7] | committer: Jean-Baptiste Kempf

libvlc: remove nativeReadDirectory

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

 libvlc/jni/libvlcjni-util.c                |   32 ----------------------------
 libvlc/src/org/videolan/libvlc/LibVLC.java |    2 --
 2 files changed, 34 deletions(-)

diff --git a/libvlc/jni/libvlcjni-util.c b/libvlc/jni/libvlcjni-util.c
index e98952d..3e9fea7 100644
--- a/libvlc/jni/libvlcjni-util.c
+++ b/libvlc/jni/libvlcjni-util.c
@@ -138,35 +138,3 @@ jobject getEventHandlerReference(JNIEnv *env, jobject thiz, jobject eventHandler
     return (*env)->NewGlobalRef(env, eventHandler);
 }
 
-void Java_org_videolan_libvlc_LibVLC_nativeReadDirectory(JNIEnv *env, jobject thiz, jstring path, jobject arrayList)
-{
-    jboolean isCopy;
-    /* Get C string */
-    const char* psz_path = (*env)->GetStringUTFChars(env, path, &isCopy);
-
-    DIR* p_dir = opendir(psz_path);
-    (*env)->ReleaseStringUTFChars(env, path, psz_path);
-    if(!p_dir)
-        return;
-
-    jclass arrayClass = (*env)->FindClass(env, "java/util/ArrayList");
-    jmethodID methodID = (*env)->GetMethodID(env, arrayClass, "add", "(Ljava/lang/Object;)Z");
-
-    struct dirent* p_dirent;
-    jstring str;
-    while(1) {
-        errno = 0;
-        p_dirent = readdir(p_dir);
-        if(p_dirent == NULL) {
-            if(errno > 0) /* error reading this entry */
-                continue;
-            else if(errno == 0) /* end of stream */
-                break;
-        }
-        str = (*env)->NewStringUTF(env, p_dirent->d_name);
-        (*env)->CallBooleanMethod(env, arrayList, methodID, str);
-        (*env)->DeleteLocalRef(env, str);
-    }
-    closedir(p_dir);
-}
-
diff --git a/libvlc/src/org/videolan/libvlc/LibVLC.java b/libvlc/src/org/videolan/libvlc/LibVLC.java
index 34aad4c..7ec60ac 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -218,8 +218,6 @@ public class LibVLC {
         return f.toURI().toString();
     }
 
-    public static native void nativeReadDirectory(String path, ArrayList<String> res);
-
     private native void setEventHandler(EventHandler eventHandler);
 
     private native void detachEventHandler();



More information about the Android mailing list