Commit ad0ce25c authored by Christopher Mueller's avatar Christopher Mueller Committed by Hugo Beauzée-Luyssen

dash: set minbuffer for stream stability

Signed-off-by: default avatarHugo Beauzée-Luyssen <beauze.h@gmail.com>
parent 2269af7b
...@@ -64,3 +64,7 @@ long AbstractAdaptationLogic::getBpsLastChunk () const ...@@ -64,3 +64,7 @@ long AbstractAdaptationLogic::getBpsLastChunk () const
{ {
return this->bpsLastChunk; return this->bpsLastChunk;
} }
int AbstractAdaptationLogic::getBufferPercent () const
{
return this->bufferedPercent;
}
...@@ -52,6 +52,7 @@ namespace dash ...@@ -52,6 +52,7 @@ namespace dash
long getBpsAvg () const; long getBpsAvg () const;
long getBpsLastChunk () const; long getBpsLastChunk () const;
int getBufferPercent () const;
private: private:
int bpsAvg; int bpsAvg;
......
...@@ -55,6 +55,9 @@ Chunk* RateBasedAdaptationLogic::getNextChunk() throw(EOFException) ...@@ -55,6 +55,9 @@ Chunk* RateBasedAdaptationLogic::getNextChunk() throw(EOFException)
long bitrate = this->getBpsAvg(); long bitrate = this->getBpsAvg();
if(this->getBufferPercent() < MINBUFFER)
bitrate = 0;
Representation *rep = this->mpdManager->getRepresentation(this->currentPeriod, bitrate, this->width, this->height); Representation *rep = this->mpdManager->getRepresentation(this->currentPeriod, bitrate, this->width, this->height);
if ( rep == NULL ) if ( rep == NULL )
......
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_stream.h> #include <vlc_stream.h>
#define MINBUFFER 30
namespace dash namespace dash
{ {
namespace logic namespace logic
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment