playbin2: don't iterate the factory lists in non-debug mode
authorStefan Kost <ensonic@users.sf.net>
Thu, 3 Dec 2009 16:08:49 +0000 (18:08 +0200)
committerStefan Kost <ensonic@users.sf.net>
Thu, 3 Dec 2009 16:08:49 +0000 (18:08 +0200)
When debugging is disabled, we won't see anything printed anyway.

gst/playback/gstfactorylists.c
gst/playback/gstfactorylists.h
gst/playback/gstplaybin2.c

index f1d1e86..eb5fb4c 100644 (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
 }
 
 /**
index c8e5075..5d4c64c 100644 (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__ */
index 67ac788..b1a8324 100644 (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;
 }