[vlc-devel] [PATCH 5/7] dash: set minbuffer for stream stability

Hugo Beauzée-Luyssen beauze.h at gmail.com
Mon Feb 20 18:42:27 CET 2012


On Mon, Feb 20, 2012 at 1:49 PM,  <Christopher at mailsrv.uni-klu.ac.at> wrote:
> From: Christopher Mueller <christopher.mueller at itec.aau.at>
>
> ---
>  .../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
> --
> 1.7.0.4
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel

Applied,

Best regards,

-- 
Hugo Beauzée-Luyssen



More information about the vlc-devel mailing list