[Android] VideoPlayerActivity: init libVLC earlier

Jean-Baptiste Kempf git at videolan.org
Fri Jul 4 04:13:41 CEST 2014


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Jul  4 04:08:58 2014 +0200| [71080d0ed257d2ea49d0ebda64bc4067ea781eca] | committer: Jean-Baptiste Kempf

VideoPlayerActivity: init libVLC earlier

This should solve numerous crashes

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=71080d0ed257d2ea49d0ebda64bc4067ea781eca
---

 .../org/videolan/vlc/gui/video/VideoPlayerActivity.java  |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 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 e91f45f..bf1a4f8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -325,6 +325,13 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
 
         mMenu = (ImageButton) findViewById(R.id.player_overlay_adv_function);
 
+        try {
+            mLibVLC = Util.getLibVlcInstance();
+        } catch (LibVlcException e) {
+            Log.d(TAG, "LibVLC initialisation failed");
+            return;
+        }
+
         mSurface = (SurfaceView) findViewById(R.id.player_surface);
         mSurfaceHolder = mSurface.getHolder();
         mSurfaceFrame = (FrameLayout) findViewById(R.id.player_surface_frame);
@@ -370,13 +377,6 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
         filter.addAction(VLCApplication.SLEEP_INTENT);
         registerReceiver(mReceiver, filter);
 
-        try {
-            mLibVLC = Util.getLibVlcInstance();
-        } catch (LibVlcException e) {
-            Log.d(TAG, "LibVLC initialisation failed");
-            return;
-        }
-
         if (mPresentation != null && !mSettings.getBoolean("enable_secondary_display_hardware_acceleration", false)) {
             mDisabledHardwareAcceleration = true;
             mPreviousHardwareAccelerationMode = mLibVLC.getHardwareAcceleration();



More information about the Android mailing list