[vlc-commits] demux: adaptative: fix bitrate maths

Francois Cartegnie git at videolan.org
Thu Nov 5 16:05:05 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Nov  5 15:57:06 2015 +0100| [be322be4264ec3043f7eced3987be981e0a06cfc] | committer: Francois Cartegnie

demux: adaptative: fix bitrate maths

::facepalm

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=be322be4264ec3043f7eced3987be981e0a06cfc
---

 modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp b/modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
index ada891f..a936f95 100644
--- a/modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
+++ b/modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
@@ -63,7 +63,7 @@ void RateBasedAdaptationLogic::updateDownloadRate(size_t size, mtime_t time)
     if(unlikely(time == 0))
         return;
 
-    size_t current = bpsRemainder + size * 8000 / time;
+    size_t current = bpsRemainder + CLOCK_FREQ * size * 8 / time;
 
     if (current >= bpsAvg)
     {



More information about the vlc-commits mailing list