Commit 2b2d61f5 authored by Geoffrey Métais's avatar Geoffrey Métais

Load VLC librairies later, and in background

parent d42ce8fe
......@@ -15,6 +15,7 @@ import android.support.v4.content.LocalBroadcastManager;
import android.text.TextUtils;
import android.util.Log;
import org.videolan.libvlc.LibVLC;
import org.videolan.libvlc.util.VLCUtil;
import org.videolan.medialibrary.interfaces.DevicesDiscoveryCb;
import org.videolan.medialibrary.interfaces.EntryPointsEventsCb;
......@@ -87,6 +88,7 @@ public class Medialibrary {
if (extFilesDir == null || !extFilesDir.exists()
|| dbDirectory == null || !dbDirectory.canWrite())
return ML_INIT_FAILED;
LibVLC.loadLibraries();
int initCode = nativeInit(dbDirectory+ VLC_MEDIA_DB_NAME, extFilesDir+ THUMBS_FOLDER_NAME);
mIsInitiated = initCode != ML_INIT_FAILED;
return initCode;
......
......@@ -36,7 +36,6 @@ import android.support.v4.util.SimpleArrayMap;
import android.util.Log;
import org.videolan.libvlc.Dialog;
import org.videolan.libvlc.LibVLC;
import org.videolan.libvlc.util.AndroidUtil;
import org.videolan.medialibrary.Medialibrary;
import org.videolan.vlc.gui.DialogActivity;
......@@ -94,21 +93,17 @@ public class VLCApplication extends Application {
setLocale();
LibVLC.loadLibraries();
runBackground(new Runnable() {
@Override
public void run() {
if (AndroidUtil.isOOrLater)
NotificationHelper.createNotificationChannels();
if (AndroidUtil.isOOrLater) NotificationHelper.createNotificationChannels();
// Prepare cache folder constants
AudioUtil.prepareCacheFolder(instance);
sTV = AndroidDevices.isAndroidTv || (!AndroidDevices.isChromeBook && !AndroidDevices.hasTsp);
if (!VLCInstance.testCompatibleCPU(instance))
return;
if (!VLCInstance.testCompatibleCPU(instance)) return;
Dialog.setCallbacks(VLCInstance.get(), mDialogCallbacks);
// Disable remote control receiver on Fire TV.
......@@ -117,10 +112,8 @@ public class VLCApplication extends Application {
}
});
if (sActivityCbListener != null)
registerActivityLifecycleCallbacks(sActivityCbListener);
else
ExternalMonitor.register(instance);
if (sActivityCbListener != null) registerActivityLifecycleCallbacks(sActivityCbListener);
else ExternalMonitor.register(instance);
}
@Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment