[vlc-commits] dash: set minbuffer for stream stability
Christopher Mueller
git at videolan.org
Mon Feb 20 18:54:08 CET 2012
vlc | branch: master | Christopher Mueller <christopher.mueller at itec.aau.at> | Mon Feb 20 13:49:23 2012 +0100| [ad0ce25c8237c8280d18db9299e7fc3aade91f24] | committer: Hugo Beauzée-Luyssen
dash: set minbuffer for stream stability
Signed-off-by: Hugo Beauzée-Luyssen <beauze.h at gmail.com>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ad0ce25c8237c8280d18db9299e7fc3aade91f24
---
.../adaptationlogic/AbstractAdaptationLogic.cpp | 4 ++++
.../dash/adaptationlogic/AbstractAdaptationLogic.h | 1 +
.../adaptationlogic/RateBasedAdaptationLogic.cpp | 3 +++
.../adaptationlogic/RateBasedAdaptationLogic.h | 2 ++
4 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.cpp b/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.cpp
index ebd0a74..da1b40e 100644
--- a/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.cpp
+++ b/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.cpp
@@ -64,3 +64,7 @@ long AbstractAdaptationLogic::getBpsLastChunk () const
{
return this->bpsLastChunk;
}
+int AbstractAdaptationLogic::getBufferPercent () const
+{
+ return this->bufferedPercent;
+}
diff --git a/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.h b/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.h
index 97be099..7f25387 100644
--- a/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.h
+++ b/modules/stream_filter/dash/adaptationlogic/AbstractAdaptationLogic.h
@@ -52,6 +52,7 @@ namespace dash
long getBpsAvg () const;
long getBpsLastChunk () const;
+ int getBufferPercent () const;
private:
int bpsAvg;
diff --git a/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp b/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
index c331e05..b3fd174 100644
--- a/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
+++ b/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
@@ -55,6 +55,9 @@ Chunk* RateBasedAdaptationLogic::getNextChunk() throw(EOFException)
long bitrate = this->getBpsAvg();
+ if(this->getBufferPercent() < MINBUFFER)
+ bitrate = 0;
+
Representation *rep = this->mpdManager->getRepresentation(this->currentPeriod, bitrate, this->width, this->height);
if ( rep == NULL )
diff --git a/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.h b/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.h
index 44d5be4..204de72 100644
--- a/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.h
+++ b/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.h
@@ -35,6 +35,8 @@
#include <vlc_common.h>
#include <vlc_stream.h>
+#define MINBUFFER 30
+
namespace dash
{
namespace logic
More information about the vlc-commits
mailing list