From: Jehan Monnier Date: Thu, 25 Apr 2013 08:39:00 +0000 (+0200) Subject: Merge commit 'a3f10cc' X-Git-Url: http://sjero.net/git/?p=linphone;a=commitdiff_plain;h=bf3e43611778efc483999cacc470aed67fc6b83d;hp=cf2c2337e334c4de95d3fca4732e996c9e2d0e3a Merge commit 'a3f10cc' --- diff --git a/coreapi/misc.c b/coreapi/misc.c index 26cdbe22..36fe7ae3 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -234,12 +234,21 @@ static int get_codec_bitrate(LinphoneCore *lc, const PayloadType *pt){ return pt->normal_bitrate; } +/* + *((codec-birate*ptime/8) + RTP header + UDP header + IP header)*8/ptime; + *ptime=1/npacket + */ static double get_audio_payload_bandwidth(LinphoneCore *lc, const PayloadType *pt){ double npacket=50; double packet_size; int bitrate; + if (strcmp(payload_type_get_mime(&payload_type_aaceld_44k), payload_type_get_mime(pt))==0) { + /*special case of aac 44K because ptime= 10ms*/ + npacket=100; + } + bitrate=get_codec_bitrate(lc,pt); - packet_size= (((double)bitrate)/(50*8))+UDP_HDR_SZ+RTP_HDR_SZ+IP4_HDR_SZ; + packet_size= (((double)bitrate)/(npacket*8))+UDP_HDR_SZ+RTP_HDR_SZ+IP4_HDR_SZ; return packet_size*8.0*npacket; }