[vlc-commits] demux: adaptative: allow timeline merging from local node

Francois Cartegnie git at videolan.org
Fri Oct 30 21:19:40 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Oct 30 19:25:02 2015 +0100| [d7020419f8caae7f314a3286009abdc4a890dbfe] | committer: Francois Cartegnie

demux: adaptative: allow timeline merging from local node

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

 modules/demux/adaptative/playlist/SegmentInformation.cpp |   11 +++++++++++
 modules/demux/adaptative/playlist/SegmentInformation.hpp |    1 +
 2 files changed, 12 insertions(+)

diff --git a/modules/demux/adaptative/playlist/SegmentInformation.cpp b/modules/demux/adaptative/playlist/SegmentInformation.cpp
index 70c1a74..1cbd36e 100644
--- a/modules/demux/adaptative/playlist/SegmentInformation.cpp
+++ b/modules/demux/adaptative/playlist/SegmentInformation.cpp
@@ -375,6 +375,17 @@ void SegmentInformation::mergeWith(SegmentInformation *updated, mtime_t prunetim
     /* FIXME: handle difference */
 }
 
+void SegmentInformation::mergeWithTimeline(SegmentTimeline *updated)
+{
+    MediaSegmentTemplate *templ = inheritSegmentTemplate();
+    if(templ)
+    {
+        SegmentTimeline *timeline = templ->segmentTimeline.Get();
+        if(timeline)
+            timeline->mergeWith(*updated);
+    }
+}
+
 void SegmentInformation::pruneBySegmentNumber(uint64_t num)
 {
     if(segmentList)
diff --git a/modules/demux/adaptative/playlist/SegmentInformation.hpp b/modules/demux/adaptative/playlist/SegmentInformation.hpp
index cd5d255..96c39d5 100644
--- a/modules/demux/adaptative/playlist/SegmentInformation.hpp
+++ b/modules/demux/adaptative/playlist/SegmentInformation.hpp
@@ -84,6 +84,7 @@ namespace adaptative
                 mtime_t getPlaybackTimeBySegmentNumber(uint64_t) const;
                 virtual void getDurationsRange(mtime_t *, mtime_t *) const;
                 virtual void mergeWith(SegmentInformation *, mtime_t);
+                virtual void mergeWithTimeline(SegmentTimeline *); /* ! don't use with global merge */
                 virtual void pruneBySegmentNumber(uint64_t);
                 virtual void runLocalUpdates(mtime_t, uint64_t);
 



More information about the vlc-commits mailing list