gstreamer/tests/old/testsuite/refcounting/mainloop.c
Thomas Vander Stichele a967370df5 gst-indent run on core
Original commit message from CVS:
gst-indent run on core
2004-03-13 15:27:01 +00:00

32 lines
513 B
C

#include <gst/gst.h>
/* test to make sure that we can do gst_main and gst_main_quit in succession */
/* FIXME: use mutexes */
gboolean mainloop = FALSE;
static gboolean
quit_main (gpointer data)
{
if (mainloop) {
mainloop = FALSE;
g_print ("-");
gst_main_quit ();
}
return TRUE;
}
int
main (int argc, gchar * argv[])
{
int i;
g_timeout_add (1, quit_main, NULL);
for (i = 0; i < 1000; ++i) {
mainloop = TRUE;
g_print ("+");
gst_main ();
}
g_print ("\n");
return 0;
}