[vlc-commits] Revert "demux: adaptative: add inertia to rate based logic"

Francois Cartegnie git at videolan.org
Mon Sep 7 11:14:25 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Sep  7 11:11:21 2015 +0200| [626c57fd6cd065227279cf369352181f845901cf] | committer: Francois Cartegnie

Revert "demux: adaptative: add inertia to rate based logic"

Fast switching should behave better with async commands

This reverts commit 63506d5add8aafe2c6767dc37d014d14e71529b3.

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

 .../adaptative/logic/RateBasedAdaptationLogic.cpp  |   21 +-------------------
 .../adaptative/logic/RateBasedAdaptationLogic.h    |    2 --
 2 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp b/modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
index e6c0e72..ada891f 100644
--- a/modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
+++ b/modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
@@ -21,9 +21,6 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
-
-#define __STDC_CONSTANT_MACROS
-
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
@@ -43,8 +40,6 @@ RateBasedAdaptationLogic::RateBasedAdaptationLogic  (int w, int h) :
 {
     width  = w;
     height = h;
-    cumulatedTime = 0;
-    stabilizer = 16;
 }
 
 BaseRepresentation *RateBasedAdaptationLogic::getCurrentRepresentation(BaseAdaptationSet *adaptSet) const
@@ -81,21 +76,7 @@ void RateBasedAdaptationLogic::updateDownloadRate(size_t size, mtime_t time)
         bpsRemainder = (bpsAvg - current) % bpsSamplecount;
     }
 
-    cumulatedTime += time;
-    if(cumulatedTime > 4 * CLOCK_FREQ / stabilizer)
-    {
-        if( currentBps <= bpsAvg * 3/4 && stabilizer < 16 )
-        {
-            stabilizer++;
-        }
-        else if( currentBps > bpsAvg * 3/4 && stabilizer > 1 )
-        {
-            stabilizer /= 2;
-        }
-
-        currentBps = bpsAvg * 3/4;
-        cumulatedTime = 0;
-    }
+    currentBps = bpsAvg * 3/4;
 }
 
 FixedRateAdaptationLogic::FixedRateAdaptationLogic(size_t bps) :
diff --git a/modules/demux/adaptative/logic/RateBasedAdaptationLogic.h b/modules/demux/adaptative/logic/RateBasedAdaptationLogic.h
index 3018a59..9fa1385 100644
--- a/modules/demux/adaptative/logic/RateBasedAdaptationLogic.h
+++ b/modules/demux/adaptative/logic/RateBasedAdaptationLogic.h
@@ -49,8 +49,6 @@ namespace adaptative
                 size_t                  bpsRemainder;
                 size_t                  bpsSamplecount;
                 size_t                  currentBps;
-                mtime_t                 cumulatedTime;
-                int                     stabilizer;
         };
 
         class FixedRateAdaptationLogic : public AbstractAdaptationLogic



More information about the vlc-commits mailing list