From 700b06dda0edc012fdf3dcb1b29e5a39542e646f Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Thu, 22 Dec 2016 10:06:42 +0100 Subject: [PATCH] Fix some case in LinphoneCoreFactoryImpl --- .../org/linphone/core/LinphoneCoreFactoryImpl.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/java/impl/org/linphone/core/LinphoneCoreFactoryImpl.java b/java/impl/org/linphone/core/LinphoneCoreFactoryImpl.java index 582d06806..eaac0e085 100644 --- a/java/impl/org/linphone/core/LinphoneCoreFactoryImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreFactoryImpl.java @@ -111,10 +111,10 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory { OpenH264DownloadHelper downloadHelper = new OpenH264DownloadHelper(context); if (downloadHelper.isCodecFound()) { - org.linphone.mediastream.Log.i("LinphoneCoreFactoryImpl"," Loading OpenH264 plugin:" + downloadHelper.getFullPathLib()); + Log.i("LinphoneCoreFactoryImpl"," Loading OpenH264 plugin:" + downloadHelper.getFullPathLib()); System.load(downloadHelper.getFullPathLib()); } else { - org.linphone.mediastream.Log.i("LinphoneCoreFactoryImpl"," Cannot load OpenH264 plugin"); + Log.i("LinphoneCoreFactoryImpl"," Cannot load OpenH264 plugin"); } return true; @@ -126,13 +126,14 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory { throws LinphoneCoreException { try { fcontext = (Context)context; - boolean openh264Enabled = loadOpenH264(fcontext); + boolean openh264Enabled = false; + if (context != null) openh264Enabled = loadOpenH264(fcontext); MediastreamerAndroidContext.setContext(context); File user = userConfig == null ? null : new File(userConfig); File factory = factoryConfig == null ? null : new File(factoryConfig); LinphoneCore lc = new LinphoneCoreImpl(listener, user, factory, userdata); lc.enableOpenH264(openh264Enabled); - if(context!=null) lc.setContext(context); + if (context != null) lc.setContext(context); return lc; } catch (IOException e) { throw new LinphoneCoreException("Cannot create LinphoneCore",e); @@ -143,11 +144,12 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory { public LinphoneCore createLinphoneCore(LinphoneCoreListener listener, Object context) throws LinphoneCoreException { try { fcontext = (Context)context; - boolean openh264Enabled = loadOpenH264(fcontext); + boolean openh264Enabled = false; + if (context != null) openh264Enabled = loadOpenH264(fcontext); MediastreamerAndroidContext.setContext(context); LinphoneCore lc = new LinphoneCoreImpl(listener); lc.enableOpenH264(openh264Enabled); - if(context!=null) lc.setContext(context); + if (context != null) lc.setContext(context); return lc; } catch (IOException e) { throw new LinphoneCoreException("Cannot create LinphoneCore",e);