summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-10-31 15:43:26 (GMT)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-10-31 15:43:26 (GMT)
commit5b5718cd20a4748a96f3173ed0f137ca4c23fc80 (patch)
tree81e8417faaf9d2bc6ce63614815eed0c7620e02e
parenta6cbe26164c61358dfc768a4e984be58c43ef9c4 (diff)
parser: Always get DelayedLink information from the objects qdata
This makes sure that it is always valid.
-rw-r--r--gst/parse/grammar.y11
1 files changed, 7 insertions, 4 deletions
diff --git a/gst/parse/grammar.y b/gst/parse/grammar.y
index 06345ce..60115ec 100644
--- a/gst/parse/grammar.y
+++ b/gst/parse/grammar.y
@@ -434,12 +434,15 @@ gst_parse_free_delayed_link (DelayedLink *link)
static void
gst_parse_found_pad (GstElement *src, GstPad *pad, gpointer data)
{
- DelayedLink *link = (DelayedLink *) data;
-
+ DelayedLink *link = g_object_get_qdata (G_OBJECT (src),
+ g_quark_from_static_string ("GstParseDelayedLink"));
+
GST_CAT_INFO (GST_CAT_PIPELINE, "trying delayed linking %s:%s to %s:%s",
GST_STR_NULL (GST_ELEMENT_NAME (src)), GST_STR_NULL (link->src_pad),
GST_STR_NULL (GST_ELEMENT_NAME (link->sink)), GST_STR_NULL (link->sink_pad));
+ g_return_if_fail (link != NULL);
+
if (gst_element_link_pads_filtered (src, link->src_pad, link->sink,
link->sink_pad, link->caps)) {
/* do this here, we don't want to get any problems later on when
@@ -482,11 +485,11 @@ gst_parse_perform_delayed_link (GstElement *src, const gchar *src_pad,
} else {
data->caps = NULL;
}
- data->signal_id = g_signal_connect (src, "pad-added",
- G_CALLBACK (gst_parse_found_pad), data);
g_object_set_qdata_full (G_OBJECT (src),
g_quark_from_static_string ("GstParseDelayedLink"), data,
(GDestroyNotify)gst_parse_free_delayed_link);
+ data->signal_id = g_signal_connect (src, "pad-added",
+ G_CALLBACK (gst_parse_found_pad), NULL);
return TRUE;
}
}