[vlc-commits] demux: dash: count ranged segment in list

Francois Cartegnie git at videolan.org
Thu Apr 30 20:50:22 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Apr 28 18:28:35 2015 +0200| [6681e69d26b7cee41e69f90bc0a10dfa8a44bac7] | committer: Francois Cartegnie

demux: dash: count ranged segment in list

otherwise splits are overriden by default segment

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

 modules/demux/dash/mpd/IsoffMainParser.cpp |   12 ++++++++----
 modules/demux/dash/mpd/IsoffMainParser.h   |    2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/modules/demux/dash/mpd/IsoffMainParser.cpp b/modules/demux/dash/mpd/IsoffMainParser.cpp
index 9c93a7c..777ce90 100644
--- a/modules/demux/dash/mpd/IsoffMainParser.cpp
+++ b/modules/demux/dash/mpd/IsoffMainParser.cpp
@@ -172,7 +172,7 @@ size_t IsoffMainParser::parseSegmentTemplate(Node *templateNode, SegmentInformat
 size_t IsoffMainParser::parseSegmentInformation(Node *node, SegmentInformation *info)
 {
     size_t total = 0;
-    parseSegmentBase(DOMHelper::getFirstChildElementByName(node, "SegmentBase"), info);
+    total += parseSegmentBase(DOMHelper::getFirstChildElementByName(node, "SegmentBase"), info);
     total += parseSegmentList(DOMHelper::getFirstChildElementByName(node, "SegmentList"), info);
     total += parseSegmentTemplate(DOMHelper::getFirstChildElementByName(node, "SegmentTemplate" ), info);
     if(node->hasAttribute("bitstreamSwitching"))
@@ -250,11 +250,12 @@ void    IsoffMainParser::setRepresentations (Node *adaptationSetNode, Adaptation
         adaptationSet->addRepresentation(this->currentRepresentation);
     }
 }
-
-void IsoffMainParser::parseSegmentBase(Node * segmentBaseNode, SegmentInformation *info)
+size_t IsoffMainParser::parseSegmentBase(Node * segmentBaseNode, SegmentInformation *info)
 {
+    size_t list_count = 0;
+
     if(!segmentBaseNode)
-        return;
+        return 0;
 
     else if(segmentBaseNode->hasAttribute("indexRange"))
     {
@@ -276,6 +277,7 @@ void IsoffMainParser::parseSegmentBase(Node * segmentBaseNode, SegmentInformatio
             seg = new Segment(info);
         }
 
+        list_count++;
         list->addSegment(seg);
         info->setSegmentList(list);
 
@@ -293,6 +295,8 @@ void IsoffMainParser::parseSegmentBase(Node * segmentBaseNode, SegmentInformatio
         parseInitSegment(DOMHelper::getFirstChildElementByName(segmentBaseNode, "Initialization"), base);
         info->setSegmentBase(base);
     }
+
+    return list_count;
 }
 
 size_t IsoffMainParser::parseSegmentList(Node * segListNode, SegmentInformation *info)
diff --git a/modules/demux/dash/mpd/IsoffMainParser.h b/modules/demux/dash/mpd/IsoffMainParser.h
index c0d52c2..66ac9c1 100644
--- a/modules/demux/dash/mpd/IsoffMainParser.h
+++ b/modules/demux/dash/mpd/IsoffMainParser.h
@@ -71,7 +71,7 @@ namespace dash
                 void    parseTimeline       (dash::xml::Node *, MediaSegmentTemplate *);
                 void    parsePeriods        (dash::xml::Node *);
                 size_t  parseSegmentInformation(dash::xml::Node *, SegmentInformation *);
-                void    parseSegmentBase    (dash::xml::Node *, SegmentInformation *);
+                size_t  parseSegmentBase    (dash::xml::Node *, SegmentInformation *);
                 size_t  parseSegmentList    (dash::xml::Node *, SegmentInformation *);
                 size_t  parseSegmentTemplate(dash::xml::Node *, SegmentInformation *);
                 void    parseProgramInformation(dash::xml::Node *, MPD *);



More information about the vlc-commits mailing list