playbin2: don't iterate the factory lists in non-debug mode

When debugging is disabled, we won't see anything printed anyway.
This commit is contained in:
Stefan Kost 2009-12-03 18:08:49 +02:00
parent ab0c93976d
commit a6cf29fd3d
3 changed files with 10 additions and 2 deletions

View file

@ -186,6 +186,7 @@ gst_factory_list_get_elements (GstFactoryListType type)
void
gst_factory_list_debug (GValueArray * array)
{
#ifndef GST_DISABLE_GST_DEBUG
gint i;
for (i = 0; i < array->n_values; i++) {
@ -197,6 +198,7 @@ gst_factory_list_debug (GValueArray * array)
GST_DEBUG ("%s", gst_plugin_feature_get_name (feature));
}
#endif
}
/**

View file

@ -39,6 +39,12 @@ void gst_factory_list_debug (GValueArray *array);
GValueArray * gst_factory_list_filter (GValueArray *array, const GstCaps *caps);
#ifndef GST_DISABLE_GST_DEBUG
#define GST_FACTORY_LIST_DEBUG(array) gst_factory_list_debug(array)
#else
#define GST_FACTORY_LIST_DEBUG(array)
#endif
G_END_DECLS
#endif /* __GST_FACTORY_LISTS_H__ */

View file

@ -1171,7 +1171,7 @@ gst_play_bin_init (GstPlayBin * playbin)
/* first filter out the interesting element factories */
playbin->elements_lock = g_mutex_new ();
gst_play_bin_update_elements_list (playbin);
gst_factory_list_debug (playbin->elements);
GST_FACTORY_LIST_DEBUG (playbin->elements);
/* add sink */
playbin->playsink = g_object_new (GST_TYPE_PLAY_SINK, NULL);
@ -2956,7 +2956,7 @@ autoplug_factories_cb (GstElement * decodebin, GstPad * pad,
g_mutex_unlock (playbin->elements_lock);
GST_DEBUG_OBJECT (playbin, "found factories %p", result);
gst_factory_list_debug (result);
GST_FACTORY_LIST_DEBUG (result);
return result;
}