[Android] Remove harmful optimization

Geoffrey Métais git at videolan.org
Fri Dec 29 11:16:27 CET 2017


vlc-android | branch: 2.5.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Dec 29 10:55:16 2017 +0100| [b445bccfeb0de48ac248944aa9ec34926161e204] | committer: Geoffrey Métais

Remove harmful optimization

(cherry picked from commit 45a6c34ab830344df97039112cf054cffc7227e5)

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

 medialibrary/jni/AndroidMediaLibrary.cpp | 11 -----------
 medialibrary/jni/AndroidMediaLibrary.h   |  2 --
 2 files changed, 13 deletions(-)

diff --git a/medialibrary/jni/AndroidMediaLibrary.cpp b/medialibrary/jni/AndroidMediaLibrary.cpp
index de8c24940..8d038bead 100644
--- a/medialibrary/jni/AndroidMediaLibrary.cpp
+++ b/medialibrary/jni/AndroidMediaLibrary.cpp
@@ -614,10 +614,6 @@ void AndroidMediaLibrary::onDiscoveryStarted( const std::string& entryPoint )
     JNIEnv *env = getEnv();
     if (env == NULL)
         return;
-    if (mainStorage.empty()) {
-        discoveryEnded = false;
-        mainStorage = entryPoint;
-    }
     jstring ep = env->NewStringUTF(entryPoint.c_str());
     jobject thiz = getWeakReference(env);
     if (thiz != NULL)
@@ -652,10 +648,6 @@ void AndroidMediaLibrary::onDiscoveryCompleted( const std::string& entryPoint )
     JNIEnv *env = getEnv();
     if (env == NULL)
         return;
-    if (!entryPoint.compare(mainStorage)) {
-        discoveryEnded = true;
-        mainStorage.clear();
-    }
     jstring ep = env->NewStringUTF(entryPoint.c_str());
     jobject thiz = getWeakReference(env);
     if (thiz) {
@@ -688,7 +680,6 @@ void AndroidMediaLibrary::onReloadCompleted( const std::string& entryPoint )
     JNIEnv *env = getEnv();
     if (env == NULL)
         return;
-    discoveryEnded = true;
     jstring ep = env->NewStringUTF(entryPoint.c_str());
     jobject thiz = getWeakReference(env);
     if (thiz) {
@@ -749,8 +740,6 @@ void AndroidMediaLibrary::onEntryPointRemoved( const std::string& entryPoint, bo
 void AndroidMediaLibrary::onParsingStatsUpdated( uint32_t percent)
 {
     m_progress = percent;
-    if (!discoveryEnded)
-        return;
     JNIEnv *env = getEnv();
     if (env == NULL)
         return;
diff --git a/medialibrary/jni/AndroidMediaLibrary.h b/medialibrary/jni/AndroidMediaLibrary.h
index b81a23df5..5f06d3db5 100644
--- a/medialibrary/jni/AndroidMediaLibrary.h
+++ b/medialibrary/jni/AndroidMediaLibrary.h
@@ -128,8 +128,6 @@ private:
     medialibrary::IMediaLibrary* p_ml;
     std::shared_ptr<AndroidDeviceLister> p_lister;
     medialibrary::IDeviceListerCb* p_DeviceListerCb = nullptr;
-    std::string mainStorage = "";
-    bool discoveryEnded = false;
     bool m_paused = false;
     uint32_t m_nbDiscovery = 0, m_progress = 0, m_mediaAddedType = 0, m_mediaUpdatedType = 0;
 };



More information about the Android mailing list