[vlc-devel] [PATCH] demux: hls: avoid redundant update of playlist

Zhao Zhili quinkblack at foxmail.com
Fri Dec 1 10:52:53 CET 2017


---
 modules/demux/hls/playlist/Parser.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/demux/hls/playlist/Parser.cpp b/modules/demux/hls/playlist/Parser.cpp
index 928962e..b549024 100644
--- a/modules/demux/hls/playlist/Parser.cpp
+++ b/modules/demux/hls/playlist/Parser.cpp
@@ -159,6 +159,12 @@ void M3U8Parser::createAndFillRepresentation(vlc_object_t *p_obj, BaseAdaptation
     if(rep)
     {
         parseSegments(p_obj, rep, tagslist);
+        if(rep->isLive())
+        {
+            /* avoid update playlist immediately */
+            uint64_t startseq = rep->getLiveStartSegmentNumber(0);
+            rep->scheduleNextUpdate(startseq);
+        }
         adaptSet->addRepresentation(rep);
     }
 }
-- 
2.7.4





More information about the vlc-devel mailing list