[Android] Don't attach vout if layout is not ready

Geoffrey Métais git at videolan.org
Mon Feb 18 17:46:22 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 18 17:35:49 2019 +0100| [718cc84d5ffeb21d42d7ca6897ed491588a4d383] | committer: Geoffrey Métais

Don't attach vout if layout is not ready

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

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 e33dfaa6d..6be831503 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -662,7 +662,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
                 vlcVout.detachViews();
         }
         final MediaPlayer mediaPlayer = mService.getMediaplayer();
-        if (!mDisplayManager.isOnRenderer()) {
+        if (!mDisplayManager.isOnRenderer() && mVideoLayout != null) {
             mediaPlayer.attachViews(mVideoLayout, mDisplayManager, true, false);
             final MediaPlayer.ScaleType size = mIsBenchmark ? MediaPlayer.ScaleType.SURFACE_FILL : MediaPlayer.ScaleType.values()[mSettings.getInt(PreferencesActivity.VIDEO_RATIO, MediaPlayer.ScaleType.SURFACE_BEST_FIT.ordinal())];
             mediaPlayer.setVideoScale(size);



More information about the Android mailing list