summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiagossantos@gmail.com>2016-07-16 15:15:21 -0300
committerThiago Santos <thiagossantos@gmail.com>2016-10-20 11:17:32 -0300
commit6eef9971be24e55099733f9cecb1fc032b67063f (patch)
treefa30a8bba3942aa1e9eb87c8d6f0a1cb5ce6dea4
parentc36ea6f56f69715a37a57dc977a3531c79c32b2d (diff)
downloadgstreamer-plugins-bad-6eef9971be24e55099733f9cecb1fc032b67063f.tar.gz
dash: properly inherit segmentlist from period
Representation can inherit SegmentList from Period if none is available from the AdaptationSet https://bugzilla.gnome.org/show_bug.cgi?id=768460
-rw-r--r--ext/dash/gstmpdparser.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c
index 10f0149a9..387bb65ed 100644
--- a/ext/dash/gstmpdparser.c
+++ b/ext/dash/gstmpdparser.c
@@ -110,7 +110,8 @@ static void
gst_mpdparser_parse_representation_base_type (GstRepresentationBaseType **
pointer, xmlNode * a_node);
static gboolean gst_mpdparser_parse_representation_node (GList ** list,
- xmlNode * a_node, GstAdaptationSetNode * parent);
+ xmlNode * a_node, GstAdaptationSetNode * parent,
+ GstPeriodNode * period_node);
static gboolean gst_mpdparser_parse_adaptation_set_node (GList ** list,
xmlNode * a_node, GstPeriodNode * parent);
static void gst_mpdparser_parse_subset_node (GList ** list, xmlNode * a_node);
@@ -1640,6 +1641,8 @@ gst_mpdparser_parse_mult_seg_base_type_ext (GstMultSegmentBaseType ** pointer,
}
}
+ has_timeline = mult_seg_base_type->SegmentTimeline != NULL;
+
if (!has_duration && !has_timeline) {
GST_ERROR ("segment has neither duration nor timeline");
goto error;
@@ -1794,7 +1797,7 @@ gst_mpdparser_parse_representation_base_type (GstRepresentationBaseType **
static gboolean
gst_mpdparser_parse_representation_node (GList ** list, xmlNode * a_node,
- GstAdaptationSetNode * parent)
+ GstAdaptationSetNode * parent, GstPeriodNode * period_node)
{
xmlNode *cur_node;
GstRepresentationNode *new_representation;
@@ -1830,7 +1833,9 @@ gst_mpdparser_parse_representation_node (GList ** list, xmlNode * a_node,
goto error;
} else if (xmlStrcmp (cur_node->name, (xmlChar *) "SegmentList") == 0) {
if (!gst_mpdparser_parse_segment_list_node
- (&new_representation->SegmentList, cur_node, parent->SegmentList))
+ (&new_representation->SegmentList, cur_node,
+ parent->SegmentList ? parent->
+ SegmentList : period_node->SegmentList))
goto error;
} else if (xmlStrcmp (cur_node->name, (xmlChar *) "BaseURL") == 0) {
gst_mpdparser_parse_baseURL_node (&new_representation->BaseURLs,
@@ -1961,7 +1966,7 @@ gst_mpdparser_parse_adaptation_set_node (GList ** list, xmlNode * a_node,
if (cur_node->type == XML_ELEMENT_NODE) {
if (xmlStrcmp (cur_node->name, (xmlChar *) "Representation") == 0) {
if (!gst_mpdparser_parse_representation_node
- (&new_adap_set->Representations, cur_node, new_adap_set))
+ (&new_adap_set->Representations, cur_node, new_adap_set, parent))
goto error;
}
}