From 645619e817582d5e7e0967f0660ed3988f200087 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Thu, 11 Jan 2018 14:41:40 +0100 Subject: [PATCH] Moving sal creation in linphone core init --- coreapi/linphonecore.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index f19682dcd..9ff41f2be 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2237,6 +2237,14 @@ static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig lc->data=userdata; lc->ringstream_autorelease=TRUE; + // We need the Sal on the Android platform helper init + lc->sal=new Sal(lc->factory); + lc->sal->set_http_proxy_host(linphone_core_get_http_proxy_host(lc)); + lc->sal->set_http_proxy_port(linphone_core_get_http_proxy_port(lc)); + + lc->sal->set_user_pointer(lc); + lc->sal->set_callbacks(&linphone_sal_callbacks); + #ifdef __ANDROID__ if (system_context) lc->platform_helper = LinphonePrivate::createAndroidPlatformHelpers(lc, system_context); @@ -2272,13 +2280,6 @@ static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig /* This allows to run event's callback in linphone_core_iterate() */ lc->msevq=ms_factory_create_event_queue(lc->factory); - lc->sal=new Sal(lc->factory); - lc->sal->set_http_proxy_host(linphone_core_get_http_proxy_host(lc)); - lc->sal->set_http_proxy_port(linphone_core_get_http_proxy_port(lc)); - - lc->sal->set_user_pointer(lc); - lc->sal->set_callbacks(&linphone_sal_callbacks); - #ifdef TUNNEL_ENABLED lc->tunnel=linphone_core_tunnel_new(lc); #endif