From 1d61cb0381d49f298b1155ef6903eaa5094df26c Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Mon, 3 Nov 2008 12:29:10 +0000 Subject: [PATCH] gst/gstregistrybinary.c: Don't bother with the GTimer if we don't output the results. Original commit message from CVS: * gst/gstregistrybinary.c: Don't bother with the GTimer if we don't output the results. --- ChangeLog | 5 +++++ gst/gstregistrybinary.c | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 533e3a8..447e814 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-11-03 Stefan Kost + + * gst/gstregistrybinary.c: + Don't bother with the GTimer if we don't output the results. + 2008-11-03 Wim Taymans Patch by: David Schleef diff --git a/gst/gstregistrybinary.c b/gst/gstregistrybinary.c index b6e6bdf..7e8764c 100644 --- a/gst/gstregistrybinary.c +++ b/gst/gstregistrybinary.c @@ -1161,21 +1161,25 @@ gboolean gst_registry_binary_read_cache (GstRegistry * registry, const char *location) { GMappedFile *mapped = NULL; - GTimer *timer = NULL; gchar *contents = NULL; gchar *in = NULL; - gdouble seconds; gsize size; GError *err = NULL; gboolean res = FALSE; gint check_magic_result; +#ifndef GST_DISABLE_GST_DEBUG + GTimer *timer = NULL; + gdouble seconds; +#endif /* make sure these types exist */ GST_TYPE_ELEMENT_FACTORY; GST_TYPE_TYPE_FIND_FACTORY; GST_TYPE_INDEX_FACTORY; +#ifndef GST_DISABLE_GST_DEBUG timer = g_timer_new (); +#endif mapped = g_mapped_file_new (location, FALSE, &err); if (err != NULL) { @@ -1235,8 +1239,10 @@ gst_registry_binary_read_cache (GstRegistry * registry, const char *location) } } +#ifndef GST_DISABLE_GST_DEBUG g_timer_stop (timer); seconds = g_timer_elapsed (timer, NULL); +#endif GST_INFO ("loaded %s in %lf seconds", location, seconds); @@ -1244,7 +1250,9 @@ gst_registry_binary_read_cache (GstRegistry * registry, const char *location) /* TODO: once we re-use the pointers to registry contents return here */ Error: +#ifndef GST_DISABLE_GST_DEBUG g_timer_destroy (timer); +#endif if (mapped) { g_mapped_file_free (mapped); } else { -- 2.7.4