don't mix tabs and spaces
[platform/upstream/gstreamer.git] / tests / old / testsuite / cleanup / cleanup5.c
index 8d9078b..5ec03b5 100644 (file)
@@ -1,20 +1,41 @@
 #include <gst/gst.h>
 
-int main(int argc,char *argv[]) 
+int
+main (int argc, char *argv[])
 {
-  GstElement *bin, *decoder;
+  GstElement *bin, *element;
+  gint i = 1000;
+  gint step = 100;
 
-  gst_init(&argc,&argv);
 
-  bin = gst_pipeline_new("pipeline");
+  free (malloc (8));            /* -lefence */
 
-  while (TRUE)
-  {
-    decoder = gst_elementfactory_make("mpeg2dec","mpeg2dec");
-    if (!decoder) 
+  gst_init (&argc, &argv);
+
+  g_mem_chunk_info ();
+
+  bin = gst_pipeline_new ("pipeline");
+
+  while (i--) {
+    GstPad *pad;
+
+    if (i % step == 0)
+      fprintf (stderr, "\r%10d", i);
+
+    element = gst_element_factory_make ("tee", "tee");
+    if (!element)
       break;
 
-    gst_bin_add(GST_BIN(bin), decoder);
-    gst_bin_remove(GST_BIN(bin), decoder);
+    pad = gst_element_get_request_pad (element, "src%d");
+
+    gst_bin_add (GST_BIN (bin), element);
+    gst_bin_remove (GST_BIN (bin), element);
+
   }
+  fprintf (stderr, "+\n");
+
+  gst_object_unref (GST_OBJECT (bin));
+
+  g_mem_chunk_info ();
+  return 0;
 }