Skip to content
Snippets Groups Projects
Commit 68c1dd90 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Keep a reference to MediaLibrary in VLC App

parent d281b50c
No related branches found
No related tags found
No related merge requests found
......@@ -56,6 +56,7 @@ public class VLCApplication extends Application {
public final static String ACTION_MEDIALIBRARY_READY = "VLC/VLCApplication";
private static VLCApplication instance;
private static Medialibrary sMedialibraryInstance;
public final static String SLEEP_INTENT = Strings.buildPkgString("SleepIntent");
......@@ -245,7 +246,10 @@ public class VLCApplication extends Application {
}
public static synchronized Medialibrary getMLInstance() {
VLCInstance.get(); // ensure VLC is loaded before medialibrary
return Medialibrary.getInstance();
if (sMedialibraryInstance == null) {
VLCInstance.get(); // ensure VLC is loaded before medialibrary
sMedialibraryInstance = Medialibrary.getInstance();
}
return sMedialibraryInstance;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment