[vlc-devel] [PATCH 1/2] Build the iomx glue code as a separate shared library

Martin Storsjö martin at martin.st
Sun Dec 18 11:43:24 CET 2011


Hi,

On Sun, 18 Dec 2011, Alexey Sokolov wrote:

> 17.12.2011 04:47, Martin Storsjö пишет:
> 
> diff --git a/vlc-android/src/org/videolan/vlc/android/LibVLC.java b/vlc-andr
> oid/src/org/videolan/vlc/android/LibVLC.java
> index 8cd436e..8f9b67a 100644
> --- a/vlc-android/src/org/videolan/vlc/android/LibVLC.java
> +++ b/vlc-android/src/org/videolan/vlc/android/LibVLC.java
> @@ -30,6 +30,11 @@ public class LibVLC {
>      /* Load library before object instantiation */
>      static {
>          try {
> +            System.loadLibrary("iomx");
> +        } catch (Throwable t) {
> +            t.printStackTrace();
> 
> Why t.printStackTrace() instead of Log.e()?

No particular reason, I can change it to a Log.e().

> Uhm, and why catching Throwable instead of only errors producable by
> System.loadLibrary()?

This also catches any RuntimeError exception. Since this is a library that 
does things outside of the public API/ABI, I tend to be extra careful. If 
this fails to load for any reason, the rest of the normal libvlc will 
still work fine, so any error from this should be caught, not just the 
normal ones. Not that I really know if any such exception really can be 
thrown here anyway.

// Martin


More information about the vlc-devel mailing list