Commit 4270cd6f authored by smorlat's avatar smorlat

fix several memory leaks.




git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@181 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent 777c3ee8
......@@ -13,6 +13,7 @@ fi
echo "Generating build scripts in linphone..."
set -x
libtoolize --copy --force
intltoolize -c --force --automake
autoheader
$ACLOCAL -I m4
$AUTOMAKE --force-missing --add-missing --copy
......
......@@ -577,6 +577,9 @@ SupportLevel linphone_payload_is_supported(LinphoneCore *lc, sdp_payload_t *payl
/* this payload is supported in our local rtp profile, so add it to the dialog rtp
profile */
rtppayload=payload_type_clone(rtppayload);
if (rtp_profile_get_payload(dialog_profile,payload->pt)!=NULL){
ms_error("Payload %s type already entered, should not happen !",rtppayload->mime_type);
}
rtp_profile_set_payload(dialog_profile,payload->pt,rtppayload);
/* add to the rtp payload type some other parameters (bandwidth) */
if (rtppayload->type==PAYLOAD_VIDEO){
......@@ -626,10 +629,6 @@ int linphone_accept_audio_offer(sdp_context_t *ctx,sdp_payload_t *payload)
PayloadType *lpt=NULL;
params=&call->audio_params;
if (call->profile==NULL){
/* create a remote user agent profile */
call->profile=remote_profile=rtp_profile_new("remote");
}
remote_profile=call->profile;
/* see if this codec is supported in our local rtp profile*/
supported=linphone_payload_is_supported(lc,payload,lc->local_profile,remote_profile,TRUE,&lpt);
......@@ -682,10 +681,6 @@ int linphone_accept_video_offer(sdp_context_t *ctx,sdp_payload_t *payload)
if (!linphone_core_video_enabled(lc)) return -1;
if (call->profile==NULL){
/* create a remote user agent profile */
call->profile=rtp_profile_new("remote");
}
params=&call->video_params;
remote_profile=call->profile;
/* see if this codec is supported in our local rtp profile*/
......
......@@ -81,6 +81,7 @@ static void linphone_call_init_common(LinphoneCall *call, char *from, char *to)
linphone_core_notify_all_friends(call->core,LINPHONE_STATUS_ONTHEPHONE);
if (linphone_core_get_firewall_policy(call->core)==LINPHONE_POLICY_USE_STUN)
linphone_core_run_stun_tests(call->core,call);
call->profile=rtp_profile_new("Call RTP profile");
}
void linphone_call_init_media_params(LinphoneCall *call){
......@@ -1210,7 +1211,6 @@ int linphone_core_invite(LinphoneCore *lc, const char *url)
ms_free(barmsg);
if (!lc->sip_conf.sdp_200_ack){
ctx=lc->call->sdpctx;
lc->call->profile=rtp_profile_clone_full(lc->local_profile);
sdpmesg=sdp_context_get_offer(ctx);
linphone_set_sdp(invite,sdpmesg);
linphone_core_init_media_streams(lc);
......@@ -1346,9 +1346,10 @@ int linphone_core_change_qos(LinphoneCore *lc, int answer)
void linphone_core_init_media_streams(LinphoneCore *lc){
lc->audiostream=audio_stream_new(linphone_core_get_audio_port(lc),linphone_core_ipv6_enabled(lc));
#ifdef VIDEO_ENABLED
lc->videostream=video_stream_new(linphone_core_get_video_port(lc),linphone_core_ipv6_enabled(lc));
if (lc->video_conf.display || lc->video_conf.capture)
lc->videostream=video_stream_new(linphone_core_get_video_port(lc),linphone_core_ipv6_enabled(lc));
#else
lc->videostream=NULL;
lc->videostream=NULL;
#endif
}
......@@ -1502,12 +1503,10 @@ int linphone_core_accept_call(LinphoneCore *lc, const char *url)
ms_error("Fail to build answer for call: err=%i",err);
return -1;
}
ms_message("eXosip_call_build_answer done");
/*if a sdp answer is computed, send it, else send an offer */
sdpmesg=call->sdpctx->answerstr;
if (sdpmesg==NULL){
offering=TRUE;
call->profile=rtp_profile_clone_full(lc->local_profile);
ms_message("generating sdp offer");
sdpmesg=sdp_context_get_offer(call->sdpctx);
......
This diff is collapsed.
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