[vlc-commits] demux: adaptive: remove getDuration()

Francois Cartegnie git at videolan.org
Fri May 24 23:43:13 CEST 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon May 20 20:14:45 2019 +0200| [167b3d148b2bcd67c67197dbf3eea82259d8a23a] | committer: Francois Cartegnie

demux: adaptive: remove getDuration()

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

 modules/demux/adaptive/PlaylistManager.cpp | 14 +++-----------
 modules/demux/adaptive/PlaylistManager.h   |  1 -
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/modules/demux/adaptive/PlaylistManager.cpp b/modules/demux/adaptive/PlaylistManager.cpp
index 6fcf0bbb77..764e24a8e0 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -340,14 +340,6 @@ vlc_tick_t PlaylistManager::getFirstDTS() const
     return mindts;
 }
 
-vlc_tick_t PlaylistManager::getDuration() const
-{
-    if (playlist->isLive())
-        return 0;
-    else
-        return playlist->duration.Get();
-}
-
 bool PlaylistManager::setPosition(vlc_tick_t time)
 {
     bool ret = true;
@@ -576,8 +568,8 @@ int PlaylistManager::doControl(int i_query, va_list args)
         {
             setBufferingRunState(false); /* stop downloader first */
 
-            const vlc_tick_t i_duration = getDuration();
-            if(i_duration == 0) /* == playlist->isLive() */
+            const vlc_tick_t i_duration = playlist->duration.Get();
+            if(i_duration == 0 || playlist->isLive())
             {
                 setBufferingRunState(true);
                 return VLC_EGENERIC;
@@ -730,7 +722,7 @@ void PlaylistManager::updateControlsContentType()
     else
     {
         cached.b_live = false;
-        cached.i_length = getDuration();
+        cached.i_length = playlist->duration.Get();
     }
 }
 
diff --git a/modules/demux/adaptive/PlaylistManager.h b/modules/demux/adaptive/PlaylistManager.h
index c324204672..d7623aea97 100644
--- a/modules/demux/adaptive/PlaylistManager.h
+++ b/modules/demux/adaptive/PlaylistManager.h
@@ -75,7 +75,6 @@ namespace adaptive
             virtual int doDemux(vlc_tick_t);
 
             virtual bool    setPosition(vlc_tick_t);
-            virtual vlc_tick_t getDuration() const;
             vlc_tick_t getResumeTime() const;
             vlc_tick_t getFirstDTS() const;
 



More information about the vlc-commits mailing list