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

Francois Cartegnie git at videolan.org
Mon Mar 30 16:15:49 CEST 2020


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon May 20 20:14:45 2019 +0200| [07c15a7e6909a55e1a84f3c16d48ee20a3f0f68e] | committer: Francois Cartegnie

demux: adaptive: remove getDuration()

(cherry picked from commit 167b3d148b2bcd67c67197dbf3eea82259d8a23a)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=07c15a7e6909a55e1a84f3c16d48ee20a3f0f68e
---

 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 b7dfec1ae0..ab0dfe07dc 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -354,14 +354,6 @@ mtime_t PlaylistManager::getFirstDTS() const
     return mindts;
 }
 
-mtime_t PlaylistManager::getDuration() const
-{
-    if (playlist->isLive())
-        return 0;
-    else
-        return playlist->duration.Get();
-}
-
 bool PlaylistManager::setPosition(mtime_t time)
 {
     bool ret = true;
@@ -600,8 +592,8 @@ int PlaylistManager::doControl(int i_query, va_list args)
         {
             setBufferingRunState(false); /* stop downloader first */
 
-            const mtime_t i_duration = getDuration();
-            if(i_duration == 0) /* == playlist->isLive() */
+            const mtime_t i_duration = playlist->duration.Get();
+            if(i_duration == 0 || playlist->isLive())
             {
                 setBufferingRunState(true);
                 return VLC_EGENERIC;
@@ -754,7 +746,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 6de06b82d2..1182d7a21f 100644
--- a/modules/demux/adaptive/PlaylistManager.h
+++ b/modules/demux/adaptive/PlaylistManager.h
@@ -75,7 +75,6 @@ namespace adaptive
             virtual int doDemux(int64_t);
 
             virtual bool    setPosition(mtime_t);
-            virtual mtime_t getDuration() const;
             mtime_t getPCR() const;
             mtime_t getFirstDTS() const;
 



More information about the vlc-commits mailing list