summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2009-11-13 15:45:52 +0200
committerStefan Kost <ensonic@users.sf.net>2009-11-13 15:46:40 +0200
commitc84d17bcaf9c181a8a210c2f7e9809b6fae448bf (patch)
tree38fecad22cb9be83f9d2c4877cd82e1583eac837
parent73f2d464b7e7bc94ea0fd6159483a925743ef9c9 (diff)
debug: add more debug logging to help tracking parsing errors
-rw-r--r--gst/gststructure.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/gst/gststructure.c b/gst/gststructure.c
index e23f71219b..3c6704fe54 100644
--- a/gst/gststructure.c
+++ b/gst/gststructure.c
@@ -1915,25 +1915,32 @@ gst_structure_parse_field (gchar * str,
while (g_ascii_isspace (*s) || (s[0] == '\\' && g_ascii_isspace (s[1])))
s++;
name = s;
- if (G_UNLIKELY (!gst_structure_parse_simple_string (s, &name_end)))
+ if (G_UNLIKELY (!gst_structure_parse_simple_string (s, &name_end))) {
+ GST_WARNING ("failed to parse simple string, str=%s", str);
return FALSE;
+ }
s = name_end;
while (g_ascii_isspace (*s) || (s[0] == '\\' && g_ascii_isspace (s[1])))
s++;
- if (G_UNLIKELY (*s != '='))
+ if (G_UNLIKELY (*s != '=')) {
+ GST_WARNING ("missing assignment operator in the field, str=%s", str);
return FALSE;
+ }
s++;
c = *name_end;
*name_end = '\0';
field->name = g_quark_from_string (name);
+ GST_DEBUG ("trying field name '%s'", name);
*name_end = c;
if (G_UNLIKELY (!gst_structure_parse_value (s, &s, &field->value,
- G_TYPE_INVALID)))
+ G_TYPE_INVALID))) {
+ GST_WARNING ("failed to parse value %s", str);
return FALSE;
+ }
*after = s;
return TRUE;
@@ -1977,10 +1984,13 @@ gst_structure_parse_value (gchar * str,
c = *type_end;
*type_end = 0;
type = gst_structure_gtype_from_abbr (type_name);
+ GST_DEBUG ("trying type name '%s'", type_name);
*type_end = c;
- if (G_UNLIKELY (type == G_TYPE_INVALID))
+ if (G_UNLIKELY (type == G_TYPE_INVALID)) {
+ GST_WARNING ("invalid type");
return FALSE;
+ }
}
while (g_ascii_isspace (*s))
@@ -2106,8 +2116,10 @@ gst_structure_from_string (const gchar * string, gchar ** end)
r++;
memset (&field, 0, sizeof (field));
- if (G_UNLIKELY (!gst_structure_parse_field (r, &r, &field)))
+ if (G_UNLIKELY (!gst_structure_parse_field (r, &r, &field))) {
+ GST_WARNING ("Failed to parse field, r=%s", r);
goto error;
+ }
gst_structure_set_field (structure, &field);
} while (TRUE);