}
static gboolean
-gst_mpdparser_get_xml_prop_duration (xmlNode * a_node,
- const gchar * property_name, gint64 default_value, gint64 * property_value)
+gst_mpdparser_get_xml_prop_duration_inner (xmlNode * a_node,
+ const gchar * property_name, gint64 default_value, gint64 * property_value,
+ gboolean allow_negative)
{
xmlChar *prop_string;
gchar *str;
goto error;
}
GST_TRACE ("found - sign at the beginning");
+ if (!allow_negative) {
+ GST_WARNING ("sign \"-\" not allowed for property '%s'", property_name);
+ goto error;
+ }
sign = -1;
str++;
len--;
}
static gboolean
+gst_mpdparser_get_xml_prop_duration (xmlNode * a_node,
+ const gchar * property_name, gint64 default_value, gint64 * property_value)
+{
+ return gst_mpdparser_get_xml_prop_duration_inner (a_node, property_name,
+ default_value, property_value, TRUE);
+}
+
+static gboolean
+gst_mpdparser_get_xml_prop_duration_unsigned (xmlNode * a_node,
+ const gchar * property_name, gint64 default_value, gint64 * property_value)
+{
+ return gst_mpdparser_get_xml_prop_duration_inner (a_node, property_name,
+ default_value, property_value, FALSE);
+}
+
+static gboolean
gst_mpdparser_get_xml_node_content (xmlNode * a_node, gchar ** content)
{
xmlChar *node_content = NULL;
&new_mpd->minBufferTime);
gst_mpdparser_get_xml_prop_duration (a_node, "timeShiftBufferDepth", -1,
&new_mpd->timeShiftBufferDepth);
- gst_mpdparser_get_xml_prop_duration (a_node, "suggestedPresentationDelay", -1,
- &new_mpd->suggestedPresentationDelay);
+ gst_mpdparser_get_xml_prop_duration_unsigned (a_node,
+ "suggestedPresentationDelay", -1, &new_mpd->suggestedPresentationDelay);
gst_mpdparser_get_xml_prop_duration (a_node, "maxSegmentDuration", -1,
&new_mpd->maxSegmentDuration);
gst_mpdparser_get_xml_prop_duration (a_node, "maxSubsegmentDuration", -1,