summaryrefslogtreecommitdiff
path: root/gst/gststructure.c
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2009-06-02 18:36:10 +0300
committerStefan Kost <ensonic@users.sf.net>2009-06-02 18:39:17 +0300
commit47d9904ebab49e362c464ef48271ebdb54cde94c (patch)
treecd1152df5d2d4c72a4847d3eebe58428f4cb0919 /gst/gststructure.c
parent71a5ebe638ed611d488c9ffedbf03b7cf9c14dac (diff)
structure: fix serialisation of nested structures.
Use string_warp/unwrap to escape delimiters, otherwise deserialisation fails. Also move GST_ASCII_IS_STRING to private header to avoid keeping it in sync. Also use '\0' when terminating a string for better readability.
Diffstat (limited to 'gst/gststructure.c')
-rw-r--r--gst/gststructure.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/gst/gststructure.c b/gst/gststructure.c
index a43b9e7a8..e66876200 100644
--- a/gst/gststructure.c
+++ b/gst/gststructure.c
@@ -1560,11 +1560,6 @@ gst_structure_value_get_generic_type (GValue * val)
return G_VALUE_TYPE (val);
}
-/* keep in sync with gstvalue.c */
-#define GST_ASCII_IS_STRING(c) (g_ascii_isalnum((c)) || ((c) == '_') || \
- ((c) == '-') || ((c) == '+') || ((c) == '/') || ((c) == ':') || \
- ((c) == '.'))
-
gboolean
priv_gst_structure_append_to_gstring (const GstStructure * structure,
GString * s)
@@ -1853,7 +1848,7 @@ gst_structure_parse_field (gchar * str,
s++;
c = *name_end;
- *name_end = 0;
+ *name_end = '\0';
field->name = g_quark_from_string (name);
*name_end = c;
@@ -1877,7 +1872,6 @@ gst_structure_parse_value (gchar * str,
int ret = 0;
GType type = default_type;
-
s = str;
while (g_ascii_isspace (*s))
s++;
@@ -1923,7 +1917,7 @@ gst_structure_parse_value (gchar * str,
return FALSE;
c = *value_end;
- *value_end = 0;
+ *value_end = '\0';
if (type == G_TYPE_INVALID) {
GType try_types[] =
{ G_TYPE_INT, G_TYPE_DOUBLE, GST_TYPE_FRACTION, G_TYPE_BOOLEAN,
@@ -1991,7 +1985,7 @@ gst_structure_from_string (const gchar * string, gchar ** end)
}
save = *w;
- *w = 0;
+ *w = '\0';
structure = gst_structure_empty_new (name);
*w = save;
@@ -2024,7 +2018,6 @@ gst_structure_from_string (const gchar * string, gchar ** end)
if (!gst_structure_parse_field (r, &r, &field))
goto error;
gst_structure_set_field (structure, &field);
-
} while (TRUE);
if (end)