From c7c1b7aaaf1a7addcc370aade0b13f149684b492 Mon Sep 17 00:00:00 2001
From: Alexandre Savard <alexandre.savard@savoirfairelinux.net>
Date: Wed, 22 Apr 2009 18:08:46 -0400
Subject: [PATCH] use float instead of int to compute max nb of sample (#1143)

---
 sflphone-common/src/audio/audiortp.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sflphone-common/src/audio/audiortp.cpp b/sflphone-common/src/audio/audiortp.cpp
index fb51a2475f..318f418a6b 100644
--- a/sflphone-common/src/audio/audiortp.cpp
+++ b/sflphone-common/src/audio/audiortp.cpp
@@ -361,10 +361,10 @@ AudioRtpRTX::sendSessionFromMic(int timestamp)
     // int maxBytesToGet = _layerSampleRate * _layerFrameSize * sizeof(SFLDataFormat) / 1000;
 
     // compute codec framesize in ms
-    int fixed_codec_framesize = (_audiocodec->getFrameSize() * 1000) / _audiocodec->getClockRate();
-    _debug("fixed_codec_framesize: %i \n", fixed_codec_framesize);
+    float fixed_codec_framesize = ((float)_audiocodec->getFrameSize() * 1000.0) / (float)_audiocodec->getClockRate();
+    _debug("fixed_codec_framesize: %i \n", (int)fixed_codec_framesize);
 
-    int maxBytesToGet = _layerSampleRate * fixed_codec_framesize * sizeof(SFLDataFormat) / 1000;
+    int maxBytesToGet = (int)((float)_layerSampleRate * fixed_codec_framesize * (float)sizeof(SFLDataFormat) / 1000.0);
     _debug("maxBytesToGet %i \n", maxBytesToGet);
 
     // available bytes inside ringbuffer
-- 
GitLab