From ceb74fe2cfd499d651dbbbb85ef80f4424e843ce Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 2 May 2009 14:39:48 +0200 Subject: [PATCH] registry: avoid calling _get_name() too much Avoid calling gst_plugin_get_name() too many times but instead cache the value. --- gst/gstregistry.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gst/gstregistry.c b/gst/gstregistry.c index 2b67902896..4dd01aa541 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -368,20 +368,22 @@ gst_registry_remove_features_for_plugin_unlocked (GstRegistry * registry, GstPlugin * plugin) { GList *f; + const gchar *name; g_return_if_fail (GST_IS_REGISTRY (registry)); g_return_if_fail (GST_IS_PLUGIN (plugin)); + name = gst_plugin_get_name (plugin); + /* Remove all features for this plugin */ f = registry->features; while (f != NULL) { GList *next = g_list_next (f); GstPluginFeature *feature = f->data; - if (feature && !strcmp (feature->plugin_name, gst_plugin_get_name (plugin))) { + if (feature && !strcmp (feature->plugin_name, name)) { GST_DEBUG_OBJECT (registry, "removing feature %p (%s) for plugin %s", - feature, gst_plugin_feature_get_name (feature), - gst_plugin_get_name (plugin)); + feature, gst_plugin_feature_get_name (feature), name); registry->features = g_list_delete_link (registry->features, f); g_hash_table_remove (registry->feature_hash, feature->name);