mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 23:36:38 +00:00
registry: avoid calling _get_name() too much
Avoid calling gst_plugin_get_name() too many times but instead cache the value.
This commit is contained in:
parent
84c5db2635
commit
ceb74fe2cf
1 changed files with 5 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue