[Android] Prevent switch to audio if media is lost

Geoffrey Métais git at videolan.org
Wed Nov 23 15:20:45 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Nov 23 15:20:01 2016 +0100| [f4678e71fa687a326affb6d172ab2dd676b0d1aa] | committer: Geoffrey Métais

Prevent switch to audio if media is lost

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index c9bf947..5d93ee3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1758,8 +1758,10 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         final IVLCVout vlcVout = mService.getVLCVout();
         if (vlcVout.areViewsAttached() && voutCount == 0) {
             /* Video track lost, open in audio mode */
-            Log.i(TAG, "Video track lost, switching to audio");
-            mSwitchingView = true;
+            if (mService.hasMedia()) {
+                Log.i(TAG, "Video track lost, switching to audio");
+                mSwitchingView = true;
+            }
             exit(RESULT_VIDEO_TRACK_LOST);
         }
     }



More information about the Android mailing list