[Android] [Patch] Support system application to read VLC Jni Library

Samuel Huang samuel22gj at gmail.com
Tue Jun 3 03:35:27 CEST 2014


Hi, VLC Developers,

Because system application can't generate "/data/app-lib/[PACKAGE_NAME]/"
automatically, this cause application can't find "libvlcjni.so" and crash.
We need to put library in "/system/lib/". Checking this path, when it can't
find library under /data/app-lib.

-------------------------------------------------------------------------------------------------------------------
diff --git a/vlc-android/src/org/videolan/libvlc/LibVlcUtil.java
b/vlc-android/src/org/videolan/libvlc/LibVlcUtil.java
index 17b7b62..6e9d557 100644
--- a/vlc-android/src/org/videolan/libvlc/LibVlcUtil.java
+++ b/vlc-android/src/org/videolan/libvlc/LibVlcUtil.java
@@ -94,9 +94,13 @@ public class LibVlcUtil {

         ElfData elf = readLib(context.getApplicationInfo().dataDir +
"/lib/libvlcjni.so");
         if(elf == null) {
-            Log.e(TAG, "WARNING: Unable to read libvlcjni.so; cannot check
device ABI!");
-            Log.e(TAG, "WARNING: Cannot guarantee correct ABI for this
build (may crash)!");
-            return true;
+         // Support system application to using VLC Library
+         elf = readLib("system/lib/libvlcjni.so");
+         if(elf == null) {
+         Log.e(TAG, "WARNING: Unable to read libvlcjni.so; cannot check
device ABI!");
+         Log.e(TAG, "WARNING: Cannot guarantee correct ABI for this build
(may crash)!");
+         return true;
+         }
         }

         String CPU_ABI = android.os.Build.CPU_ABI;
-------------------------------------------------------------------------------------------------------------------

Wish it is useful : )

Cheers,
Samuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/android/attachments/20140603/f9672215/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: application/octet-stream
Size: 2174 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/android/attachments/20140603/f9672215/attachment.obj>


More information about the Android mailing list