[vlc-commits] demux: adaptative: merge segment info on double set

Francois Cartegnie git at videolan.org
Tue Sep 22 00:38:50 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Sep 16 16:30:46 2015 +0200| [99f578d3dd50f88c06790961a45512b6550c92dd] | committer: Francois Cartegnie

demux: adaptative: merge segment info on double set

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

 .../demux/adaptative/playlist/SegmentInformation.cpp  |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/modules/demux/adaptative/playlist/SegmentInformation.cpp b/modules/demux/adaptative/playlist/SegmentInformation.cpp
index a809c7b..e355493 100644
--- a/modules/demux/adaptative/playlist/SegmentInformation.cpp
+++ b/modules/demux/adaptative/playlist/SegmentInformation.cpp
@@ -326,16 +326,31 @@ mtime_t SegmentInformation::getPeriodStart() const
 
 void SegmentInformation::setSegmentList(SegmentList *list)
 {
-    segmentList = list;
+    if(segmentList)
+    {
+        segmentList->mergeWith(list);
+        delete list;
+    }
+    else
+    {
+        segmentList = list;
+    }
 }
 
 void SegmentInformation::setSegmentBase(SegmentBase *base)
 {
+    if(segmentBase)
+        delete segmentBase;
     segmentBase = base;
 }
 
 void SegmentInformation::setSegmentTemplate(MediaSegmentTemplate *templ)
 {
+    if(mediaSegmentTemplate)
+    {
+        mediaSegmentTemplate->mergeWith(templ, 0);
+        delete templ;
+    }
     mediaSegmentTemplate = templ;
 }
 



More information about the vlc-commits mailing list