[Android] libVLC: code cleanup

Jean-Baptiste Kempf git at videolan.org
Tue Jun 2 00:05:15 CEST 2015


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Jun  1 23:58:03 2015 +0200| [1c0563267fcadfadf492e79fb0de578fd3b098c1] | committer: Jean-Baptiste Kempf

libVLC: code cleanup

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

 libvlc/src/org/videolan/libvlc/media/MediaPlayer.java |    2 +-
 libvlc/src/org/videolan/libvlc/util/VLCUtil.java      |    7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/libvlc/src/org/videolan/libvlc/media/MediaPlayer.java b/libvlc/src/org/videolan/libvlc/media/MediaPlayer.java
index 0e9dc2f..b613119 100644
--- a/libvlc/src/org/videolan/libvlc/media/MediaPlayer.java
+++ b/libvlc/src/org/videolan/libvlc/media/MediaPlayer.java
@@ -264,7 +264,7 @@ public class MediaPlayer
         public String toString() {
             return "";
         }
-    };
+    }
 
     public TrackInfo[] getTrackInfo() throws IllegalStateException {
         //FIXME
diff --git a/libvlc/src/org/videolan/libvlc/util/VLCUtil.java b/libvlc/src/org/videolan/libvlc/util/VLCUtil.java
index 60d0fe2..b3b5c16 100644
--- a/libvlc/src/org/videolan/libvlc/util/VLCUtil.java
+++ b/libvlc/src/org/videolan/libvlc/util/VLCUtil.java
@@ -306,7 +306,7 @@ public class VLCUtil {
     @TargetApi(Build.VERSION_CODES.GINGERBREAD)
     private static File searchLibrary(ApplicationInfo applicationInfo) {
         // Search for library path
-        String[] libraryPaths = null;
+        String[] libraryPaths;
         if ((applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
             final String property = System.getProperty("java.library.path");
             libraryPaths = property.split(":");
@@ -317,18 +317,17 @@ public class VLCUtil {
             else
                 libraryPaths[0] = applicationInfo.dataDir + "/lib";
         }
-        if (libraryPaths == null) {
+        if (libraryPaths[0] == null) {
             Log.e(TAG, "can't find library path");
             return null;
         }
 
         // Search for libvlcjni.so
-        File lib = null;
+        File lib;
         for (String libraryPath : libraryPaths) {
             lib = new File(libraryPath, "libvlcjni.so");
             if (lib.exists() && lib.canRead())
                 return lib;
-            ;
         }
         Log.e(TAG, "WARNING: Can't find shared library");
         return null;



More information about the Android mailing list