RateBasedAdaptationLogic::RateBasedAdaptationLogic (MPD *mpd) :
AbstractAdaptationLogic (mpd),
- bpsAvg(0), bpsSamplecount(0)
+ bpsAvg(0), bpsSamplecount(0),
+ currentBps(0)
{
width = var_InheritInteger(mpd->getVLCObject(), "dash-prefwidth");
height = var_InheritInteger(mpd->getVLCObject(), "dash-prefheight");
return NULL;
RepresentationSelector selector;
- Representation *rep = selector.select(currentPeriod, type, bpsAvg, width, height);
+ Representation *rep = selector.select(currentPeriod, type, currentBps, width, height);
if ( rep == NULL )
{
rep = selector.select(currentPeriod, type);
bpsAvg = bpsAvg - (bpsAvg - current) / (bpsSamplecount + 1);
bpsSamplecount++;
+
+ if(bpsSamplecount % 5 == 0)
+ currentBps = bpsAvg;
}