[Android] JNI: update init with SetupConfig

Duncan McNamara git at videolan.org
Thu Feb 24 10:58:19 UTC 2022


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Thu Jan 20 17:21:59 2022 +0100| [28ecc9e6043ca52de0ad46490fc98af59801b684] | committer: Nicolas Pomepuy

JNI: update init with SetupConfig

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

 medialibrary/jni/AndroidMediaLibrary.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/medialibrary/jni/AndroidMediaLibrary.cpp b/medialibrary/jni/AndroidMediaLibrary.cpp
index 64cb7f008..5b5e3c999 100644
--- a/medialibrary/jni/AndroidMediaLibrary.cpp
+++ b/medialibrary/jni/AndroidMediaLibrary.cpp
@@ -27,11 +27,13 @@ static void key_init(void)
 }
 
 AndroidMediaLibrary::AndroidMediaLibrary(JavaVM *vm, fields *ref_fields, jobject thiz, const char* dbPath, const char* mlFolder)
-    : p_ml( NewMediaLibrary( dbPath, mlFolder, false ) )
-    , p_fields ( ref_fields )
+    : p_fields ( ref_fields )
 {
     myVm = vm;
     p_lister = std::make_shared<AndroidDeviceLister>();
+    medialibrary::SetupConfig config;
+    config.deviceListers["file://"] = p_lister;
+    p_ml = NewMediaLibrary( dbPath, mlFolder, false, &config);
     p_ml->setLogger( new AndroidMediaLibraryLogger );
     p_ml->setVerbosity(medialibrary::LogLevel::Debug);
     pthread_once(&key_once, key_init);
@@ -50,7 +52,6 @@ AndroidMediaLibrary::~AndroidMediaLibrary()
 medialibrary::InitializeResult
 AndroidMediaLibrary::initML()
 {
-    p_ml->registerDeviceLister(p_lister, "file://");
     return p_ml->initialize(this);
 }
 



More information about the Android mailing list