[gst-cvs] gstreamer: gsttypefind: Use _CAST variants when the type has alredy been checked.
Edward Hervey
bilboed at kemper.freedesktop.org
Sun Nov 1 23:34:56 PST 2009
Module: gstreamer
Branch: master
Commit: 0aff2c55b7bd7672c52a621d1fba788840207ec0
URL: http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=0aff2c55b7bd7672c52a621d1fba788840207ec0
Author: Edward Hervey <bilboed at bilboed.com>
Date: Mon Nov 2 08:28:20 2009 +0100
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 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gst/gsttypefind.c b/gst/gsttypefind.c
index 8f43b26..59dbd05 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));
More information about the Gstreamer-commits
mailing list