[Android] Displaymanager: Fix logic fail

Geoffrey Métais git at videolan.org
Fri Apr 20 11:06:31 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Apr 20 11:06:12 2018 +0200| [0d3958d503bf3f7f11a1d249f7d0cfe2c155fbb1] | committer: Geoffrey Métais

Displaymanager: Fix logic fail

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

 vlc-android/src/org/videolan/vlc/gui/video/DisplayManager.kt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/DisplayManager.kt b/vlc-android/src/org/videolan/vlc/gui/video/DisplayManager.kt
index 0f1654783..ef9ad9d8a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/DisplayManager.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/DisplayManager.kt
@@ -122,11 +122,11 @@ class DisplayManager(private val activity: Activity, cloneMode: Boolean) {
             mediaRouterCallback = object : MediaRouter.SimpleCallback() {
                 override fun onRoutePresentationDisplayChanged(
                         router: MediaRouter, info: MediaRouter.RouteInfo) {
-                    if (BuildConfig.DEBUG) Log.d(TAG, "onRoutePresentationDisplayChanged: info=" + info)
+                    if (BuildConfig.DEBUG) Log.d(TAG, "onRoutePresentationDisplayChanged: info=$info")
                     val newDisplayId = info.presentationDisplay?.displayId ?: -1
                     if (newDisplayId == presentationDisplayId) return
                     presentationDisplayId = newDisplayId
-                    if (presentationDisplayId != -1) removePresentation() else updateDisplayType()
+                    if (newDisplayId == -1) removePresentation() else updateDisplayType()
                 }
             }
             mediaRouter?.addCallback(MediaRouter.ROUTE_TYPE_LIVE_VIDEO, mediaRouterCallback)



More information about the Android mailing list