[Android] Playback: pause medialibrary scan sooner
Geoffrey Métais
git at videolan.org
Wed Oct 17 10:28:34 CEST 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Oct 15 17:54:26 2018 +0200| [45e27d099c1756190a9a205ec2359940fedbe4de] | committer: Geoffrey Métais
Playback: pause medialibrary scan sooner
> https://code.videolan.org/videolan/vlc-android/commit/45e27d099c1756190a9a205ec2359940fedbe4de
---
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
index c34399132..0d77bd045 100644
--- a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -112,6 +112,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
Log.w(TAG, "Warning: empty media list, nothing to play !")
return
}
+ medialibrary.pauseBackgroundOperations()
currentIndex = if (isValidPosition(position)) position else 0
// Add handler after loading the list
@@ -210,6 +211,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
mediaList.clear()
showAudioPlayer.value = false
service.onPlaybackStopped(systemExit)
+ medialibrary.resumeBackgroundOperations()
}
@MainThread
@@ -253,6 +255,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
suspend fun playIndex(index: Int, flags: Int = 0) {
if (mediaList.size() == 0) {
Log.w(TAG, "Warning: empty media list, nothing to play !")
+ medialibrary.resumeBackgroundOperations()
return
}
currentIndex = if (isValidPosition(index)) {
More information about the Android
mailing list