--- /dev/null
+From 9cf1100a4a5f227c372d493bc3ae176401da5af6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim.muller@collabora.co.uk>
+Date: Tue, 29 Sep 2009 12:33:39 +0100
+Subject: [PATCH] gst-tagread: add --loop=N command line option to tagreading
+ example
+
+This is useful for testing and benchmarking purposes.
+---
+ tests/examples/tagreading/gst-tagread.c | 14 +++++++++++++-
+ 1 files changed, 13 insertions(+), 1 deletions(-)
+
+diff --git a/tests/examples/tagreading/gst-tagread.c b/tests/examples/tagreading/gst-tagread.c
+index 4576b5f..0f94ce9 100644
+--- a/tests/examples/tagreading/gst-tagread.c
++++ b/tests/examples/tagreading/gst-tagread.c
+@@ -25,6 +25,7 @@
+ #include <glib/gi18n.h>
+
+ static gboolean print_version = FALSE;
++static gint loop_iterations = 1;
+
+ static GstElement *tagreadbin = NULL;
+
+@@ -171,7 +172,7 @@ process_file (const gchar * filename)
+ GList *tags;
+ GDir *dir;
+ gchar *uri, *path;
+- guint i;
++ guint i, loop;
+
+ /* Recurse into directories */
+ if ((dir = g_dir_open (filename, 0, NULL))) {
+@@ -209,6 +210,10 @@ process_file (const gchar * filename)
+ return;
+ }
+
++ loop = loop_iterations;
++
++again:
++
+ /* now get the tags */
+ tags = extract_tags (uri);
+
+@@ -228,6 +233,11 @@ process_file (const gchar * filename)
+ ++i;
+ }
+
++ if (loop > 1) {
++ --loop;
++ goto again;
++ }
++
+ g_free (uri);
+ }
+
+@@ -241,6 +251,8 @@ main (int argc, char **argv)
+ GOptionEntry options[] = {
+ {"version", 0, 0, G_OPTION_ARG_NONE, &print_version,
+ N_("Print version information and exit"), NULL},
++ {"loop", 'l', 0, G_OPTION_ARG_INT, &loop_iterations,
++ N_("Print version information and exit"), NULL},
+ {G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &filenames, NULL},
+ {NULL}
+ };