From a6cf29fd3df1b47cb22439a7dfce84c65f4f8ab5 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Thu, 3 Dec 2009 18:08:49 +0200 Subject: [PATCH] playbin2: don't iterate the factory lists in non-debug mode When debugging is disabled, we won't see anything printed anyway. --- gst/playback/gstfactorylists.c | 2 ++ gst/playback/gstfactorylists.h | 6 ++++++ gst/playback/gstplaybin2.c | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gst/playback/gstfactorylists.c b/gst/playback/gstfactorylists.c index f1d1e86..eb5fb4c 100644 --- a/gst/playback/gstfactorylists.c +++ b/gst/playback/gstfactorylists.c @@ -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 } /** diff --git a/gst/playback/gstfactorylists.h b/gst/playback/gstfactorylists.h index c8e5075..5d4c64c 100644 --- a/gst/playback/gstfactorylists.h +++ b/gst/playback/gstfactorylists.h @@ -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__ */ diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index 67ac788..b1a8324 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -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; } -- 2.7.4