mpdparser: Allow inherit Segment{Base,Template} from Period
authorSeungha Yang <sh.yang@lge.com>
Mon, 27 Mar 2017 01:06:30 +0000 (10:06 +0900)
committerThiago Santos <thiagossantos@gmail.com>
Sun, 16 Apr 2017 01:33:41 +0000 (18:33 -0700)
Similar to SegmentList, Representation can inherit Segment{Base,Template}
from Period

https://bugzilla.gnome.org/show_bug.cgi?id=780570

ext/dash/gstmpdparser.c

index 41212ab..33340a4 100644 (file)
@@ -1896,11 +1896,13 @@ gst_mpdparser_parse_representation_node (GList ** list, xmlNode * a_node,
     if (cur_node->type == XML_ELEMENT_NODE) {
       if (xmlStrcmp (cur_node->name, (xmlChar *) "SegmentBase") == 0) {
         gst_mpdparser_parse_seg_base_type_ext (&new_representation->SegmentBase,
-            cur_node, parent->SegmentBase);
+            cur_node, parent->SegmentBase ?
+            parent->SegmentBase : period_node->SegmentBase);
       } else if (xmlStrcmp (cur_node->name, (xmlChar *) "SegmentTemplate") == 0) {
         if (!gst_mpdparser_parse_segment_template_node
             (&new_representation->SegmentTemplate, cur_node,
-                parent->SegmentTemplate))
+                parent->SegmentTemplate ?
+                parent->SegmentTemplate : period_node->SegmentTemplate))
           goto error;
       } else if (xmlStrcmp (cur_node->name, (xmlChar *) "SegmentList") == 0) {
         if (!gst_mpdparser_parse_segment_list_node