[Android] Medialibrary: Avoid double init

Geoffrey Métais git at videolan.org
Wed Dec 18 14:19:47 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Dec 18 11:55:14 2019 +0100| [b1c99f29a3dcb8f0c21bac1195f2ab584437482c] | committer: Geoffrey Métais

Medialibrary: Avoid double init

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

 vlc-android/src/org/videolan/vlc/MediaParsingService.kt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/MediaParsingService.kt b/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
index 98afad2a0..ffceedfdc 100644
--- a/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
+++ b/vlc-android/src/org/videolan/vlc/MediaParsingService.kt
@@ -429,6 +429,10 @@ class MediaParsingService : LifecycleService(), DevicesDiscoveryCb, LifecycleOwn
                 medialibrary.discover(action.path)
             }
             is Init -> {
+                if (medialibrary.isInitiated) {
+                    exitCommand()
+                    return at actor
+                }
                 val context = this at MediaParsingService
                 var shouldInit = !dbExists()
                 val initCode = medialibrary.init(context)



More information about the Android mailing list