summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2009-01-27 23:09:05 +0200
committerStefan Kost <ensonic@users.sf.net>2009-01-27 23:10:36 +0200
commit00fdca0c14eb9a5fe6b8b9f2d5ce2313e3b32f23 (patch)
tree10b0835aa10deb25ffbef5dc3ecefc6b64a2b45e /tests
parent3c1f1b195f4ba2754815b1a963f8487ce59d19fe (diff)
Fix example apps by drawing in the main-loop.
Diffstat (limited to 'tests')
-rw-r--r--tests/examples/spectrum/demo-audiotest.c19
-rw-r--r--tests/examples/spectrum/demo-osssrc.c19
2 files changed, 24 insertions, 14 deletions
diff --git a/tests/examples/spectrum/demo-audiotest.c b/tests/examples/spectrum/demo-audiotest.c
index d21857a2..d04552d1 100644
--- a/tests/examples/spectrum/demo-audiotest.c
+++ b/tests/examples/spectrum/demo-audiotest.c
@@ -93,16 +93,21 @@ draw_spectrum (gfloat * data)
/* process delayed message */
static gboolean
-delayed_spectrum_update (GstClock * sync_clock, GstClockTime time,
- GstClockID id, gpointer user_data)
+delayed_idle_spectrum_update (gpointer user_data)
{
- if (!GST_CLOCK_TIME_IS_VALID (time))
- goto done;
-
draw_spectrum ((gfloat *) user_data);
-
-done:
g_free (user_data);
+ return (FALSE);
+}
+
+static gboolean
+delayed_spectrum_update (GstClock * sync_clock, GstClockTime time,
+ GstClockID id, gpointer user_data)
+{
+ if (GST_CLOCK_TIME_IS_VALID (time))
+ g_idle_add (delayed_idle_spectrum_update, user_data);
+ else
+ g_free (user_data);
return (TRUE);
}
diff --git a/tests/examples/spectrum/demo-osssrc.c b/tests/examples/spectrum/demo-osssrc.c
index dd19ca1f..c7ae8462 100644
--- a/tests/examples/spectrum/demo-osssrc.c
+++ b/tests/examples/spectrum/demo-osssrc.c
@@ -82,16 +82,21 @@ draw_spectrum (gfloat * data)
/* process delayed message */
static gboolean
-delayed_spectrum_update (GstClock * sync_clock, GstClockTime time,
- GstClockID id, gpointer user_data)
+delayed_idle_spectrum_update (gpointer user_data)
{
- if (!GST_CLOCK_TIME_IS_VALID (time))
- goto done;
-
draw_spectrum ((gfloat *) user_data);
-
-done:
g_free (user_data);
+ return (FALSE);
+}
+
+static gboolean
+delayed_spectrum_update (GstClock * sync_clock, GstClockTime time,
+ GstClockID id, gpointer user_data)
+{
+ if (GST_CLOCK_TIME_IS_VALID (time))
+ g_idle_add (delayed_idle_spectrum_update, user_data);
+ else
+ g_free (user_data);
return (TRUE);
}