Commit 660621ca authored by Andy Wingo Wingo's avatar Andy Wingo Wingo
Browse files

fix bug when requesting pads by name

Original commit message from CVS:
* fix bug when requesting pads by name
* added api: gst_element_get_managing_bin ()
parent fbe0d0ba
......@@ -735,7 +735,7 @@ gst_element_request_pad_by_name (GstElement *element, const gchar *name)
}
}
if (templ == NULL)
if (!templ_found)
return NULL;
pad = gst_element_request_pad (element, templ, req_name);
......@@ -1908,3 +1908,18 @@ gst_element_install_std_props (GstElementClass * klass, const char *first_name,
va_end (args);
}
GstBin*
gst_element_get_managing_bin (GstElement *element)
{
GstBin *bin;
g_return_val_if_fail (element != NULL, NULL);
bin = GST_BIN (gst_object_get_parent (GST_OBJECT_CAST (element)));
while (bin && !GST_FLAG_IS_SET (GST_OBJECT_CAST (bin), GST_BIN_FLAG_MANAGER))
bin = GST_BIN (gst_object_get_parent (GST_OBJECT_CAST (bin)));
return bin;
}
......@@ -246,6 +246,8 @@ GstElementFactory* gst_element_get_factory (GstElement *element);
void gst_element_install_std_props (GstElementClass *klass,
const char *first_name, ...);
GstBin* gst_element_get_managing_bin (GstElement *element);
/*
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment