]> sjero.net Git - linphone/commitdiff
call->audio_bw should be rouded to the upper value
authorJehan Monnier <jehan.monnier@linphone.org>
Tue, 26 Feb 2013 16:29:28 +0000 (17:29 +0100)
committerJehan Monnier <jehan.monnier@linphone.org>
Tue, 26 Feb 2013 16:29:28 +0000 (17:29 +0100)
coreapi/misc.c

index 927c3b55a2636b55eef5402285c54be1a59f22a5..e84c8cce9a51f6e90c10b35cf5f5dba7fb8aaa6a 100644 (file)
@@ -43,7 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include <net/if.h>
 #include <ifaddrs.h>
 #endif
-
+#include <math.h>
 
 #if !defined(WIN32)
 
@@ -244,7 +244,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);
+       call->audio_bw=(int)(ceil(get_audio_payload_bandwidth(call->core,pt)/1000.0)); /*rounding codec bandwidth should be avoid, specially for AMR*/
        ms_message("Audio bandwidth for this call is %i",call->audio_bw);
 }