[Android] List available entryPoints only

Geoffrey Métais git at videolan.org
Fri Jan 6 18:37:46 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jan  6 18:35:36 2017 +0100| [0c20590491f2c0992f16f4a563c5be482ee72dee] | committer: Geoffrey Métais

List available entryPoints only

> https://code.videolan.org/videolan/vlc-android/commit/0c20590491f2c0992f16f4a563c5be482ee72dee
---

 medialibrary/jni/medialibrary.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/medialibrary/jni/medialibrary.cpp b/medialibrary/jni/medialibrary.cpp
index 14a92a1..ba7a8a2 100644
--- a/medialibrary/jni/medialibrary.cpp
+++ b/medialibrary/jni/medialibrary.cpp
@@ -106,6 +106,7 @@ entryPoints(JNIEnv* env, jobject thiz)
 {
     AndroidMediaLibrary *aml = MediaLibrary_getInstance(env, thiz);
     std::vector<medialibrary::FolderPtr> entryPoints = aml->entryPoints();
+    entryPoints.erase(std::remove_if( begin( entryPoints ), end( entryPoints ), []( const medialibrary::FolderPtr f ) { return f->isPresent() == false; } ));
     jobjectArray mediaRefs = (jobjectArray) env->NewObjectArray(entryPoints.size(), env->FindClass("java/lang/String"), NULL);
     int index = -1;
     for(medialibrary::FolderPtr const& entrypoint : entryPoints) {



More information about the Android mailing list