[vlc-commits] demux: smooth: refresh playlist on stream reactivation

Francois Cartegnie git at videolan.org
Tue Nov 10 11:17:42 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Nov 10 11:00:22 2015 +0100| [9569a5283a9dcafaa3d4473496c04717b3196623] | committer: Francois Cartegnie

demux: smooth: refresh playlist on stream reactivation

Since smooth adds new segments from segments data,
we need to resync for unselected streams.

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

 modules/demux/adaptative/Streams.hpp   |    2 +-
 modules/demux/smooth/SmoothManager.cpp |   17 ++++++++++++++---
 modules/demux/smooth/SmoothManager.hpp |    4 ++++
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/modules/demux/adaptative/Streams.hpp b/modules/demux/adaptative/Streams.hpp
index 8400cf2..ffc76b8 100644
--- a/modules/demux/adaptative/Streams.hpp
+++ b/modules/demux/adaptative/Streams.hpp
@@ -68,7 +68,7 @@ namespace adaptative
         int esCount() const;
         bool seekAble() const;
         bool isSelected() const;
-        bool reactivate(mtime_t);
+        virtual bool reactivate(mtime_t);
         bool isDisabled() const;
         typedef enum {status_eof, status_eop, status_dis, status_buffering, status_demuxed} status;
         status demux(mtime_t, bool);
diff --git a/modules/demux/smooth/SmoothManager.cpp b/modules/demux/smooth/SmoothManager.cpp
index 42e9ed9..238804d 100644
--- a/modules/demux/smooth/SmoothManager.cpp
+++ b/modules/demux/smooth/SmoothManager.cpp
@@ -89,6 +89,11 @@ Manifest * SmoothManager::fetchManifest()
 
 bool SmoothManager::updatePlaylist()
 {
+    return updatePlaylist(false);
+}
+
+bool SmoothManager::updatePlaylist(bool forcemanifest)
+{
     /* FIXME: do update from manifest after resuming from pause */
     if(!playlist->isLive() || !playlist->minUpdatePeriod.Get())
         return true;
@@ -107,8 +112,8 @@ bool SmoothManager::updatePlaylist()
 
     /* Timelines updates should be inlined in tfrf atoms.
        We'll just care about pruning live timeline then. */
-#if 0
-    if(nextPlaylistupdate)
+
+    if(forcemanifest && nextPlaylistupdate)
     {
         Manifest *newManifest = fetchManifest();
         if(newManifest)
@@ -125,7 +130,6 @@ bool SmoothManager::updatePlaylist()
 #endif
         }
     }
-#endif
 
     /* Compute new Manifest update time */
     if(!mininterval && !maxinterval)
@@ -148,6 +152,13 @@ bool SmoothManager::updatePlaylist()
     return true;
 }
 
+bool SmoothManager::reactivateStream(AbstractStream *stream)
+{
+    if(playlist->isLive())
+        updatePlaylist(true);
+    return PlaylistManager::reactivateStream(stream);
+}
+
 bool SmoothManager::isSmoothStreaming(xml::Node *root)
 {
     return root->getName() == "SmoothStreamingMedia";
diff --git a/modules/demux/smooth/SmoothManager.hpp b/modules/demux/smooth/SmoothManager.hpp
index 9d89115..cc531c5 100644
--- a/modules/demux/smooth/SmoothManager.hpp
+++ b/modules/demux/smooth/SmoothManager.hpp
@@ -48,7 +48,11 @@ namespace smooth
             static bool isSmoothStreaming(xml::Node *);
             static bool mimeMatched(const std::string &);
 
+        protected:
+            virtual bool reactivateStream(AbstractStream *); /* reimpl */
+
         private:
+            bool updatePlaylist(bool);
             playlist::Manifest * fetchManifest();
     };
 



More information about the vlc-commits mailing list