[vlc-commits] demux: adaptive: add playlist max buffer value

Francois Cartegnie git at videolan.org
Sat Jul 9 18:42:43 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Jul  2 09:09:18 2016 +0200| [798169a15cf643c70784e5d518435851c724c958] | committer: Francois Cartegnie

demux: adaptive: add playlist max buffer value

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

 modules/demux/adaptive/playlist/AbstractPlaylist.cpp |    6 ++++++
 modules/demux/adaptive/playlist/AbstractPlaylist.hpp |    1 +
 2 files changed, 7 insertions(+)

diff --git a/modules/demux/adaptive/playlist/AbstractPlaylist.cpp b/modules/demux/adaptive/playlist/AbstractPlaylist.cpp
index d30d847..c3bbf1d 100644
--- a/modules/demux/adaptive/playlist/AbstractPlaylist.cpp
+++ b/modules/demux/adaptive/playlist/AbstractPlaylist.cpp
@@ -86,6 +86,12 @@ mtime_t AbstractPlaylist::getMinBuffering() const
     return std::max(minBufferTime, 6*CLOCK_FREQ);
 }
 
+mtime_t AbstractPlaylist::getMaxBuffering() const
+{
+    const mtime_t minbuf = getMinBuffering();
+    return std::min(minbuf * 3 / 2, minbuf + 6 * CLOCK_FREQ);
+}
+
 Url AbstractPlaylist::getUrlSegment() const
 {
     Url ret;
diff --git a/modules/demux/adaptive/playlist/AbstractPlaylist.hpp b/modules/demux/adaptive/playlist/AbstractPlaylist.hpp
index 35fdb22..ac69107 100644
--- a/modules/demux/adaptive/playlist/AbstractPlaylist.hpp
+++ b/modules/demux/adaptive/playlist/AbstractPlaylist.hpp
@@ -44,6 +44,7 @@ namespace adaptive
                 void                            setType(const std::string &);
                 void                            setMinBuffering( mtime_t );
                 mtime_t                         getMinBuffering() const;
+                mtime_t                         getMaxBuffering() const;
                 virtual void                    debug() = 0;
 
                 void    addPeriod               (BasePeriod *period);



More information about the vlc-commits mailing list