From 7b835688e13593323e0b0a413fea84f1dd899396 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 13 Dec 2010 14:24:33 +0100 Subject: [PATCH] bugfixes in bw --- coreapi/linphonecall.c | 2 +- coreapi/misc.c | 1 + coreapi/offeranswer.c | 4 +++- coreapi/sal_eXosip2.c | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 63d881bba..bd62d6c83 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -738,7 +738,7 @@ static RtpProfile *make_profile(LinphoneCall *call, const SalMediaDescription *m /*case where b=AS is given globally, not per stream*/ remote_bw=md->bandwidth; if (desc->type==SalVideo){ - remote_bw-=call->audio_bw-10; + remote_bw-=call->audio_bw+10; } } diff --git a/coreapi/misc.c b/coreapi/misc.c index c2e1ae211..4ee5347f4 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -235,6 +235,7 @@ static double get_audio_payload_bandwidth(LinphoneCore *lc, const PayloadType *p void linphone_core_update_allocated_audio_bandwidth_in_call(LinphoneCall *call, const PayloadType *pt){ call->audio_bw=(int)(get_audio_payload_bandwidth(call->core,pt)/1000.0); + ms_message("Audio bandwidth for this call is %i",call->audio_bw); } void linphone_core_update_allocated_audio_bandwidth(LinphoneCore *lc){ diff --git a/coreapi/offeranswer.c b/coreapi/offeranswer.c index 0db6b08a4..91de86e29 100644 --- a/coreapi/offeranswer.c +++ b/coreapi/offeranswer.c @@ -161,7 +161,7 @@ static void initiate_incoming(const SalStreamDescription *local_cap, strcpy(result->addr,local_cap->addr); result->port=local_cap->port; result->bandwidth=local_cap->bandwidth; - result->ptime=local_cap->ptime; + result->ptime=local_cap->ptime; }else{ result->port=0; } @@ -187,6 +187,7 @@ int offer_answer_initiate_outgoing(const SalMediaDescription *local_offer, else ms_warning("No matching stream for %i",i); } result->nstreams=j; + result->bandwidth=remote_answer->bandwidth; strcpy(result->addr,remote_answer->addr); return 0; } @@ -214,6 +215,7 @@ int offer_answer_initiate_incoming(const SalMediaDescription *local_capabilities result->nstreams=j; strcpy(result->username, local_capabilities->username); strcpy(result->addr,local_capabilities->addr); + result->bandwidth=local_capabilities->bandwidth; return 0; } diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index fb0eb49ea..69a281537 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -455,6 +455,8 @@ static void sdp_process(SalOp *h){ int i; offer_answer_initiate_incoming(h->base.local_media,h->base.remote_media,h->result,h->base.root->one_matching_codec); h->sdp_answer=media_description_to_sdp(h->result); + /*once we have generated the SDP answer, we modify the result description for processing by the upper layer. + It should contains media parameters constraint from the remote offer, not our response*/ strcpy(h->result->addr,h->base.remote_media->addr); h->result->bandwidth=h->base.remote_media->bandwidth; for(i=0;iresult->nstreams;++i){ @@ -637,6 +639,7 @@ int sal_ping(SalOp *op, const char *from, const char *to){ sal_op_set_from(op,from); sal_op_set_to(op,to); + /*bug here: eXosip2 does not honor the route argument*/ eXosip_options_build_request (&options, sal_op_get_to(op), sal_op_get_from(op),sal_op_get_route(op)); if (options){