[Android] Remove harmful optimization

Geoffrey Métais git at videolan.org
Tue Jan 16 17:45:19 CET 2018


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

Remove harmful optimization

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

 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