From ad008198e0db9d4832e8a845be91157721ab4326 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 11 Nov 2003 12:34:15 +0000 Subject: [PATCH] fix an old bug traversing pad template lists, and change _padtemplates to _pad_templates in new functions Original commit message from CVS: fix an old bug traversing pad template lists, and change _padtemplates to _pad_templates in new functions --- gst/gstelement.c | 6 ++++-- gst/gstelement.h | 4 ++-- gst/gstelementfactory.c | 14 +++++++------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/gst/gstelement.c b/gst/gstelement.c index 7890054..aba9010 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -1638,7 +1638,7 @@ gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname, srctempl = (GstPadTemplate*) srctempls->data; if (srctempl->presence == GST_PAD_REQUEST) { for (l=desttempls; l; l=l->next) { - desttempl = (GstPadTemplate*) desttempls->data; + desttempl = (GstPadTemplate*) l->data; if (desttempl->presence == GST_PAD_REQUEST && desttempl->direction != srctempl->direction) { if (gst_caps_is_always_compatible (gst_pad_template_get_caps (srctempl), @@ -1654,7 +1654,9 @@ gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname, GST_DEBUG_PAD_NAME (destpad)); return TRUE; } - /* FIXME: we have extraneous request pads lying around */ + /* it failed, so we release the request pads */ + gst_element_release_request_pad (src, srcpad); + gst_element_release_request_pad (dest, destpad); } } } diff --git a/gst/gstelement.h b/gst/gstelement.h index cb46500..2a98341 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -417,8 +417,8 @@ G_CONST_RETURN gchar * gst_element_factory_get_klass (GstElementFactory *factor G_CONST_RETURN gchar * gst_element_factory_get_description (GstElementFactory *factory); G_CONST_RETURN gchar * gst_element_factory_get_version (GstElementFactory *factory); G_CONST_RETURN gchar * gst_element_factory_get_author (GstElementFactory *factory); -guint gst_element_factory_get_num_padtemplates (GstElementFactory *factory); -G_CONST_RETURN GList * gst_element_factory_get_padtemplates (GstElementFactory *factory); +guint gst_element_factory_get_num_pad_templates (GstElementFactory *factory); +G_CONST_RETURN GList * gst_element_factory_get_pad_templates (GstElementFactory *factory); GstElement* gst_element_factory_create (GstElementFactory *factory, const gchar *name); diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c index 577dabc..595f0ca 100644 --- a/gst/gstelementfactory.c +++ b/gst/gstelementfactory.c @@ -373,30 +373,30 @@ gst_element_factory_get_author (GstElementFactory *factory) return factory->details.author; } /** - * gst_element_factory_get_num_padtemplates: + * gst_element_factory_get_num_pad_templates: * @factory: a #GstElementFactory * - * Gets the number of padtemplates in this factory. + * Gets the number of pad_templates in this factory. * - * Returns: the number of padtemplates + * Returns: the number of pad_templates */ guint -gst_element_factory_get_num_padtemplates (GstElementFactory *factory) +gst_element_factory_get_num_pad_templates (GstElementFactory *factory) { g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), 0); return factory->numpadtemplates; } /** - * gst_element_factory_get_padtemplates: + * gst_element_factory_get_pad_templates: * @factory: a #GstElementFactory * - * Gets the #Glist of padtemplates for this factory. + * Gets the #Glist of pad templates for this factory. * * Returns: the padtemplates */ G_CONST_RETURN GList * -gst_element_factory_get_padtemplates (GstElementFactory *factory) +gst_element_factory_get_pad_templates (GstElementFactory *factory) { g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL); -- 2.7.4