mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
dash: strip lead/trailing whitespace from descriptortype attributes
The spec says it is xs:anyURI and leading and trailing whitespace are to be ignored https://bugzilla.gnome.org/show_bug.cgi?id=758064
This commit is contained in:
parent
5b6b24859f
commit
aa7a3cb24f
1 changed files with 15 additions and 1 deletions
|
@ -38,6 +38,8 @@ static gboolean gst_mpdparser_get_xml_prop_validated_string (xmlNode * a_node,
|
|||
gboolean (*validator) (const char *));
|
||||
static gboolean gst_mpdparser_get_xml_prop_string (xmlNode * a_node,
|
||||
const gchar * property_name, gchar ** property_value);
|
||||
static gboolean gst_mpdparser_get_xml_prop_string_stripped (xmlNode * a_node,
|
||||
const gchar * property_name, gchar ** property_value);
|
||||
static gboolean gst_mpdparser_get_xml_ns_prop_string (xmlNode * a_node,
|
||||
const gchar * ns_name, const gchar * property_name,
|
||||
gchar ** property_value);
|
||||
|
@ -310,6 +312,18 @@ gst_mpdparser_get_xml_prop_string (xmlNode * a_node,
|
|||
property_value, NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_mpdparser_get_xml_prop_string_stripped (xmlNode * a_node,
|
||||
const gchar * property_name, gchar ** property_value)
|
||||
{
|
||||
gboolean ret;
|
||||
ret =
|
||||
gst_mpdparser_get_xml_prop_string (a_node, property_name, property_value);
|
||||
if (ret)
|
||||
*property_value = g_strstrip (*property_value);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_mpdparser_validate_no_whitespace (const char *s)
|
||||
{
|
||||
|
@ -1291,7 +1305,7 @@ gst_mpdparser_parse_descriptor_type_node (GList ** list, xmlNode * a_node)
|
|||
*list = g_list_append (*list, new_descriptor);
|
||||
|
||||
GST_LOG ("attributes of %s node:", a_node->name);
|
||||
gst_mpdparser_get_xml_prop_string (a_node, "schemeIdUri",
|
||||
gst_mpdparser_get_xml_prop_string_stripped (a_node, "schemeIdUri",
|
||||
&new_descriptor->schemeIdUri);
|
||||
if (!gst_mpdparser_get_xml_prop_string (a_node, "value",
|
||||
&new_descriptor->value)) {
|
||||
|
|
Loading…
Reference in a new issue