[Android] videoPlayer: fix custom aspect ratio from start

Duncan McNamara git at videolan.org
Thu Jul 26 11:46:54 CEST 2018


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Wed Jul 25 17:56:09 2018 +0200| [7247e7e79eaae2cf8b73364edfb6b1e62c17a48f] | committer: Geoffrey Métais

videoPlayer: fix custom aspect ratio from start

The aspect ratio was set when an ES was selected,
instead of the vout, hence the aspect ratio was
not set for the new vout and fellback to default

Signed-off-by: Geoffrey Métais <geoffrey.metais at gmail.com>

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

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 3 ++-
 1 file changed, 2 insertions(+), 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 ef44120b0..c00275821 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1512,6 +1512,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
                 break;
             case MediaPlayer.Event.Vout:
                 updateNavStatus();
+                if (event.getVoutCount() > 0)
+                    changeSurfaceLayout();
                 if (mMenuIdx == -1)
                     handleVout(event.getVoutCount());
                 break;
@@ -1542,7 +1544,6 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             case MediaPlayer.Event.ESSelected:
                 if (event.getEsChangedType() == Media.VideoTrack.Type.Video) {
                     Media.VideoTrack vt = mService.getCurrentVideoTrack();
-                    changeSurfaceLayout();
                     if (vt != null)
                         mFov = vt.projection == Media.VideoTrack.Projection.Rectangular ? 0f : DEFAULT_FOV;
                 }



More information about the Android mailing list