[vlc-commits] adaptive: use secf from vlc_tick_t functions for conversion

Steve Lhomme git at videolan.org
Thu Jul 5 16:17:14 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jun 15 09:37:53 2018 +0200| [82c8d6c9095e69bfdc0383fd56bb303249b7f5d7] | committer: Steve Lhomme

adaptive: use secf from vlc_tick_t functions for conversion

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

 modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp b/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp
index 096a2def5d..a311d4cece 100644
--- a/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp
+++ b/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp
@@ -106,7 +106,7 @@ BaseRepresentation *NearOptimalAdaptationLogic::getNextRepresentation(BaseAdapta
     vlc_mutex_unlock(&lock);
 
     const float gammaP = 1.0 + (umax - umin) / ((float)ctxcopy.buffering_target / ctxcopy.buffering_min - 1.0);
-    const float Vd = ((float)ctxcopy.buffering_min / CLOCK_FREQ - 1.0) / (umin + gammaP);
+    const float Vd = (secf_from_vlc_tick(ctxcopy.buffering_min) - 1.0) / (umin + gammaP);
 
     BaseRepresentation *m;
     if(prevRep == NULL) /* Starting */
@@ -117,7 +117,7 @@ BaseRepresentation *NearOptimalAdaptationLogic::getNextRepresentation(BaseAdapta
     {
         /* noted m* */
         m = getNextQualityIndex(adaptSet, selector, gammaP - umin /* umin == Sm, utility = std::log(S/Sm) */,
-                                Vd, (float)ctxcopy.buffering_level / CLOCK_FREQ);
+                                Vd, secf_from_vlc_tick(ctxcopy.buffering_level));
         if(m->getBandwidth() < prevRep->getBandwidth()) /* m*[n] < m*[n-1] */
         {
             BaseRepresentation *mp = selector.select(adaptSet, bps); /* m' */



More information about the vlc-commits mailing list