[Android] MediaParsing: Fix channel closed too early

Geoffrey Métais git at videolan.org
Mon Dec 23 09:10:24 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Dec 23 09:09:46 2019 +0100| [93e1983d54b27e1fd5f8860e4b36dc6a8e2fb3ea] | committer: Geoffrey Métais

MediaParsing: Fix channel closed too early

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

 .../src/org/videolan/vlc/MediaParsingService.kt        | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/MediaParsingService.kt b/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
index c99552ca3..4d64d7577 100644
--- a/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
+++ b/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
@@ -431,16 +431,16 @@ class MediaParsingService : LifecycleService(), DevicesDiscoveryCb, LifecycleOwn
             is Init -> {
                 if (medialibrary.isInitiated) {
                     exitCommand()
-                    return at actor
+                } else {
+                    val context = this at MediaParsingService
+                    var shouldInit = !dbExists()
+                    val initCode = medialibrary.init(context)
+                    if (initCode != Medialibrary.ML_INIT_ALREADY_INITIALIZED) {
+                        shouldInit = shouldInit or (initCode == Medialibrary.ML_INIT_DB_RESET) or (initCode == Medialibrary.ML_INIT_DB_CORRUPTED)
+                        if (initCode != Medialibrary.ML_INIT_FAILED) initMedialib(action.parse, context, shouldInit, action.upgrade)
+                        else exitCommand()
+                    } else exitCommand()
                 }
-                val context = this at MediaParsingService
-                var shouldInit = !dbExists()
-                val initCode = medialibrary.init(context)
-                if (initCode != Medialibrary.ML_INIT_ALREADY_INITIALIZED) {
-                    shouldInit = shouldInit or (initCode == Medialibrary.ML_INIT_DB_RESET) or (initCode == Medialibrary.ML_INIT_DB_CORRUPTED)
-                    if (initCode != Medialibrary.ML_INIT_FAILED) initMedialib(action.parse, context, shouldInit, action.upgrade)
-                    else exitCommand()
-                } else exitCommand()
             }
             is StartScan -> {
                 scanActivated = true



More information about the Android mailing list