[Android] VideoPlayerActivity: detect projection from EsSelected events

Thomas Guillem git at videolan.org
Mon Apr 3 12:03:53 CEST 2017


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Mar 31 11:56:44 2017 +0200| [a2dc52f6e3483a33346d05bd31944834555caba6] | committer: Thomas Guillem

VideoPlayerActivity: detect projection from EsSelected events

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java   | 11 +++++++----
 1 file changed, 7 insertions(+), 4 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 6c931bb..57bff79 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1626,6 +1626,13 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
                 }
                 invalidateESTracks(event.getEsChangedType());
                 break;
+            case MediaPlayer.Event.ESSelected:
+                if (event.getEsChangedType() == Media.VideoTrack.Type.Video) {
+                    Media.VideoTrack vt = mService.getCurrentVideoTrack();
+                    if (vt != null)
+                        mFov = vt.projection == Media.VideoTrack.Projection.Rectangular ? 0f : DEFAULT_FOV;
+                }
+                break;
             case MediaPlayer.Event.SeekableChanged:
                 updateSeekable(event.getSeekable());
                 break;
@@ -1778,10 +1785,6 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         final IVLCVout vlcVout = mService.getVLCVout();
         if (vlcVout.areViewsAttached() && voutCount == 0) {
             mHandler.postDelayed(mSwitchAudioRunnable, 4000);
-        } else if (voutCount > 0) {
-            Media.VideoTrack vt = mService.getCurrentVideoTrack();
-            if (vt != null)
-                mFov = vt.projection == Media.VideoTrack.Projection.Rectangular ? 0f : DEFAULT_FOV;
         }
     }
 



More information about the Android mailing list