From 0aff2c55b7bd7672c52a621d1fba788840207ec0 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 2 Nov 2009 08:28:20 +0100 Subject: [PATCH] gsttypefind: Use _CAST variants when the type has alredy been checked. This avoids checking the type n_typefinders * 4 times when loading the registry. --- gst/gsttypefind.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gst/gsttypefind.c b/gst/gsttypefind.c index 8f43b2604e..59dbd05d34 100644 --- a/gst/gsttypefind.c +++ b/gst/gsttypefind.c @@ -85,8 +85,8 @@ gst_type_find_register (GstPlugin * plugin, const gchar * name, guint rank, GST_DEBUG_OBJECT (factory, "using new typefind factory for %s", name); g_assert (GST_IS_TYPE_FIND_FACTORY (factory)); - gst_plugin_feature_set_name (GST_PLUGIN_FEATURE (factory), name); - gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE (factory), rank); + gst_plugin_feature_set_name (GST_PLUGIN_FEATURE_CAST (factory), name); + gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE_CAST (factory), rank); if (factory->extensions) g_strfreev (factory->extensions); @@ -97,11 +97,11 @@ gst_type_find_register (GstPlugin * plugin, const gchar * name, guint rank, factory->user_data = data; factory->user_data_notify = data_notify; if (plugin && plugin->desc.name) { - GST_PLUGIN_FEATURE (factory)->plugin_name = plugin->desc.name; /* interned string */ + GST_PLUGIN_FEATURE_CAST (factory)->plugin_name = plugin->desc.name; /* interned string */ } else { - GST_PLUGIN_FEATURE (factory)->plugin_name = "NULL"; + GST_PLUGIN_FEATURE_CAST (factory)->plugin_name = "NULL"; } - GST_PLUGIN_FEATURE (factory)->loaded = TRUE; + GST_PLUGIN_FEATURE_CAST (factory)->loaded = TRUE; gst_registry_add_feature (gst_registry_get_default (), GST_PLUGIN_FEATURE (factory));