[Android] Fix songs order

Geoffrey Métais git at videolan.org
Thu Mar 30 15:54:59 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Mar 30 15:40:14 2017 +0200| [cbada0e69384a73e970d955efed9df5a83ee581b] | committer: Geoffrey Métais

Fix songs order

Optional parameter don't work from JNI calls

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

 medialibrary/jni/medialibrary.cpp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/medialibrary/jni/medialibrary.cpp b/medialibrary/jni/medialibrary.cpp
index 1e43098..e6d0a1b 100644
--- a/medialibrary/jni/medialibrary.cpp
+++ b/medialibrary/jni/medialibrary.cpp
@@ -252,8 +252,8 @@ getVideos(JNIEnv* env, jobject thiz)
     return videoRefs;
 }
 
-jobjectArray
-getAudio(JNIEnv* env, jobject thiz, medialibrary::SortingCriteria sort = medialibrary::SortingCriteria::Default, bool desc = false)
+static jobjectArray
+getInternalAudio(JNIEnv* env, jobject thiz, medialibrary::SortingCriteria sort = medialibrary::SortingCriteria::Default, bool desc = false)
 {
     AndroidMediaLibrary *aml = MediaLibrary_getInstance(env, thiz);
     std::vector<medialibrary::MediaPtr> audioFiles = aml->audioFiles(sort, desc);
@@ -268,9 +268,15 @@ getAudio(JNIEnv* env, jobject thiz, medialibrary::SortingCriteria sort = mediali
 }
 
 jobjectArray
+getAudio(JNIEnv* env, jobject thiz)
+{
+    return getInternalAudio(env, thiz);
+}
+
+jobjectArray
 getRecentAudio(JNIEnv* env, jobject thiz)
 {
-    return getAudio(env, thiz, medialibrary::SortingCriteria::InsertionDate, true);
+    return getInternalAudio(env, thiz, medialibrary::SortingCriteria::InsertionDate, true);
 }
 
 jobject



More information about the Android mailing list