diff options
author | Edward Hervey <bilboed@bilboed.com> | 2009-10-19 09:06:16 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2009-10-22 11:13:47 +0200 |
commit | 4b13520b6188ed755a22bf52bd3a4f442e8442b9 (patch) | |
tree | 3f1586049060c1a3eaab3dc5edbc63f1a2c7f9f7 | |
parent | 2f7b348fc0b6fd2aa3925613e45c87978f1c8476 (diff) |
gstregistry: Use hash table when finding a feature. Fixes #598895
-rw-r--r-- | gst/gstregistry.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/gst/gstregistry.c b/gst/gstregistry.c index 9fdb392da8..23f61ada28 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -659,25 +659,15 @@ gst_registry_find_feature (GstRegistry * registry, const gchar * name, GType type) { GstPluginFeature *feature = NULL; - GList *walk; - GstTypeNameData data; g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL); g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (g_type_is_a (type, GST_TYPE_PLUGIN_FEATURE), NULL); - data.name = name; - data.type = type; - - walk = gst_registry_feature_filter (registry, - (GstPluginFeatureFilter) gst_plugin_feature_type_name_filter, - TRUE, &data); - - if (walk) { - feature = GST_PLUGIN_FEATURE_CAST (walk->data); - - gst_object_ref (feature); - gst_plugin_feature_list_free (walk); + feature = gst_registry_lookup_feature (registry, name); + if (feature && !g_type_is_a (G_TYPE_FROM_INSTANCE (feature), type)) { + gst_object_unref (feature); + feature = NULL; } return feature; |