Commit ceb74fe2 authored by Wim Taymans's avatar Wim Taymans Committed by Wim Taymans
Browse files

registry: avoid calling _get_name() too much

Avoid calling gst_plugin_get_name() too many times but instead cache
the value.
parent 84c5db26
......@@ -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);
......
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