2007-10-15 Stefan Kost <ensonic@users.sf.net>
+ * gst/gststructure.c:
+ * gst/gstvalue.c:
+ Add some more comments and debug output. Quote structure name to fix
+ deserialisation of some strings.
+
+2007-10-15 Stefan Kost <ensonic@users.sf.net>
+
* gst/gstbuffer.h:
Define GST_BUFFER_FLAG_GAP more strictly to enable optimizations based
on it. Fix docs for GST_BUFFER_MALLOCDATA and GstBuffer.malloc_data.
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) == '.'))
s = g_string_new ("");
/* FIXME this string may need to be escaped */
- g_string_append_printf (s, "%s", g_quark_to_string (structure->name));
+ g_string_append_printf (s, "\"%s\"", g_quark_to_string (structure->name));
for (i = 0; i < structure->fields->len; i++) {
char *t;
GType type;
GType range_type;
gboolean ret;
-
if (*s != '[')
return FALSE;
s++;
r = copy;
name = r;
- if (!gst_structure_parse_string (r, &w, &r))
+ if (!gst_structure_parse_string (r, &w, &r)) {
+ GST_WARNING ("Failed to parse structure string");
goto error;
+ }
+ /* skip spaces */
while (g_ascii_isspace (*r) || (r[0] == '\\' && g_ascii_isspace (r[1])))
r++;
- if (*r != 0 && *r != ';' && *r != ',')
+ if (*r != 0 && *r != ';' && *r != ',') {
+ GST_WARNING ("Failed to find delimiter, r=%s", r);
goto error;
+ }
save = *w;
*w = 0;
*w = save;
while (*r && (*r != ';')) {
- if (*r != ',')
+ if (*r != ',') {
+ GST_WARNING ("Failed to find delimiter, r=%s", r);
goto error;
+ }
r++;
while (*r && (g_ascii_isspace (*r) || (r[0] == '\\'
&& g_ascii_isspace (r[1]))))