[Android] VideoPlayerActivity: subtitle surface is never gone

Thomas Guillem git at videolan.org
Mon Nov 28 16:39:14 CET 2016


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Nov 24 16:53:04 2016 +0100| [2560def77ac71a229696941d878ef910f39fb09c] | committer: Thomas Guillem

VideoPlayerActivity: subtitle surface is never gone

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java  | 12 ++++--------
 1 file changed, 4 insertions(+), 8 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 d3ab45d..c6b8a90 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -782,12 +782,10 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         }
         if (mPresentation == null) {
             vlcVout.setVideoView(mSurfaceView);
-            if (mSubtitlesSurfaceView.getVisibility() != View.GONE)
-                vlcVout.setSubtitlesView(mSubtitlesSurfaceView);
+            vlcVout.setSubtitlesView(mSubtitlesSurfaceView);
         } else {
             vlcVout.setVideoView(mPresentation.mSurfaceView);
-            if (mPresentation.mSubtitlesSurfaceView.getVisibility() != View.GONE)
-                vlcVout.setSubtitlesView(mPresentation.mSubtitlesSurfaceView);
+            vlcVout.setSubtitlesView(mPresentation.mSubtitlesSurfaceView);
         }
         vlcVout.addCallback(this);
         vlcVout.attachViews();
@@ -1905,8 +1903,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         lp.width  = (int) Math.ceil(dw * mVideoWidth / mVideoVisibleWidth);
         lp.height = (int) Math.ceil(dh * mVideoHeight / mVideoVisibleHeight);
         surface.setLayoutParams(lp);
-        if (subtitlesSurface != null)
-            subtitlesSurface.setLayoutParams(lp);
+        subtitlesSurface.setLayoutParams(lp);
 
         // set frame size (crop if necessary)
         lp = surfaceFrame.getLayoutParams();
@@ -1915,8 +1912,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         surfaceFrame.setLayoutParams(lp);
 
         surface.invalidate();
-        if (subtitlesSurface != null)
-            subtitlesSurface.invalidate();
+        subtitlesSurface.invalidate();
     }
 
     private void sendMouseEvent(int action, int button, int x, int y) {



More information about the Android mailing list