[Android] LibVLC: keep context instance

Thomas Guillem git at videolan.org
Wed Mar 8 15:07:22 CET 2017


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar  7 16:19:18 2017 +0100| [9d992ad4df5586bc7b1efa5cb7f09bbc66a8dc0b] | committer: Thomas Guillem

LibVLC: keep context instance

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

 libvlc/src/org/videolan/libvlc/LibVLC.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libvlc/src/org/videolan/libvlc/LibVLC.java b/libvlc/src/org/videolan/libvlc/LibVLC.java
index 0d6d158..45ccb01 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -32,6 +32,7 @@ import java.util.ArrayList;
 @SuppressWarnings("unused, JniMissingFunction")
 public class LibVLC extends VLCObject<LibVLC.Event> {
     private static final String TAG = "VLC/LibVLC";
+    final Context mAppContext;
 
     public static class Event extends VLCEvent {
         protected Event(int type) {
@@ -45,6 +46,7 @@ public class LibVLC extends VLCObject<LibVLC.Event> {
      * @param options
      */
     public LibVLC(Context context, ArrayList<String> options) {
+        mAppContext = context.getApplicationContext();
         loadLibraries();
 
         if (options == null)



More information about the Android mailing list