[Android] VideoPlayer: Reset navStatus var later

Geoffrey Métais git at videolan.org
Mon Apr 27 15:32:53 CEST 2020


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Apr 21 11:05:03 2020 +0200| [351cd63621af6423a6a2372b8366d5067e95076b] | committer: Nicolas Pomepuy

VideoPlayer: Reset navStatus var later

Avoid race conditions

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt           | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index bfcdfe30f..9dc170e01 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -2078,7 +2078,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
     internal fun hideOverlay(fromUser: Boolean) {
         if (isShowing) {
             handler.removeMessages(FADE_OUT)
-            Log.i(TAG, "remove View!")
+            Log.v(TAG, "remove View!")
             overlayTips.setInvisible()
             if (!displayManager.isPrimary) {
                 overlayBackground?.startAnimation(AnimationUtils.loadAnimation(this, android.R.anim.fade_out))
@@ -2288,7 +2288,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
             val continueplayback = isPlaying && (restorePlayback || positionInPlaylist == service.currentMediaPosition)
             if (resumePlaylist) {
                 // Provided externally from AudioService
-                if (BuildConfig.DEBUG) Log.d(TAG, "Continuing playback from PlaybackService at index $positionInPlaylist")
+                if (BuildConfig.DEBUG) Log.v(TAG, "Continuing playback from PlaybackService at index $positionInPlaylist")
                 openedMedia = service.media[positionInPlaylist]
                 itemTitle = openedMedia.title
                 updateSeekable(service.isSeekable)
@@ -2587,11 +2587,11 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
 
     private fun updateNavStatus() {
         if (service == null) return
-        isNavMenu = false
         menuIdx = -1
         lifecycleScope.launchWhenStarted {
             val titles = withContext(Dispatchers.IO) { service?.titles }
             if (isFinishing) return at launchWhenStarted
+            isNavMenu = false
             if (titles != null) {
                 val currentIdx = service?.titleIdx ?: return at launchWhenStarted
                 for (i in titles.indices) {



More information about the Android mailing list