diff options
author | Tim-Philipp Müller <tim@centricular.net> | 2007-07-08 14:11:53 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2007-07-08 14:11:53 +0000 |
commit | cf8abdf3a362feb3aa90530a5527c2d6803d0331 (patch) | |
tree | b0d318a41cb908ab807e9f6d8356ba671ccf3086 /gst/gststructure.c | |
parent | 286cd75855a993863481ded180f02f11ffb5ead2 (diff) |
gst/gststructure.c: When deserialising foo=bar without a type cast, check if it's a boolean before falling back to a ...
Original commit message from CVS:
* gst/gststructure.c: (gst_structure_parse_value):
When deserialising foo=bar without a type cast, check if it's a
boolean before falling back to a string type, otherwise things like
audiotestsrc ! audio/x-raw-int,signed=true ! fakesink won't work,
because the filtercaps end up having a signed=(string)true field,
which causes problems later when intersection caps.
* tests/check/gst/gststructure.c: (GST_START_TEST):
Add a unit test for this.
Diffstat (limited to 'gst/gststructure.c')
-rw-r--r-- | gst/gststructure.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gst/gststructure.c b/gst/gststructure.c index e8f40dffe..1ccb857dd 100644 --- a/gst/gststructure.c +++ b/gst/gststructure.c @@ -1769,10 +1769,12 @@ gst_structure_parse_value (gchar * str, *value_end = 0; if (type == G_TYPE_INVALID) { GType try_types[] = - { G_TYPE_INT, G_TYPE_DOUBLE, GST_TYPE_FRACTION, G_TYPE_STRING }; + { G_TYPE_INT, G_TYPE_DOUBLE, GST_TYPE_FRACTION, G_TYPE_BOOLEAN, + G_TYPE_STRING + }; int i; - for (i = 0; i < 4; i++) { + for (i = 0; i < G_N_ELEMENTS (try_types); i++) { g_value_init (value, try_types[i]); ret = gst_value_deserialize (value, value_s); if (ret) |