element: don't crash on missing template

Some request pads don't have a padtemplate (mostly those from encodebin). Avoid
crashing in this case.
This commit is contained in:
Wim Taymans 2012-01-31 16:27:55 +01:00
parent 5e4c13fc97
commit 76a60c4c42

View file

@ -316,8 +316,9 @@ gst_element_release_request_pad (GstElement * element, GstPad * pad)
g_return_if_fail (GST_IS_ELEMENT (element));
g_return_if_fail (GST_IS_PAD (pad));
g_return_if_fail (GST_PAD_TEMPLATE_PRESENCE (GST_PAD_PAD_TEMPLATE (pad))
== GST_PAD_REQUEST);
g_return_if_fail (GST_PAD_PAD_TEMPLATE (pad) == NULL ||
GST_PAD_TEMPLATE_PRESENCE (GST_PAD_PAD_TEMPLATE (pad)) ==
GST_PAD_REQUEST);
oclass = GST_ELEMENT_GET_CLASS (element);