From: <en...@ke...> - 2009-08-06 12:54:17
|
Module: gst-plugins-base Branch: master Commit: 513f37534533405e92311a369659fe606bddee52 URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=513f37534533405e92311a369659fe606bddee52 Author: Stefan Kost <en...@us...> Date: Fri Jul 31 14:27:28 2009 +0300 colorkey-test: fix xsync error --- tests/icles/test-colorkey.c | 23 +++++++++++++++++------ 1 files changed, 17 insertions(+), 6 deletions(-) diff --git a/tests/icles/test-colorkey.c b/tests/icles/test-colorkey.c index 08a8b23..b0ba42a 100644 --- a/tests/icles/test-colorkey.c +++ b/tests/icles/test-colorkey.c @@ -148,6 +148,21 @@ window_closed (GtkWidget * widget, GdkEvent * event, gpointer user_data) gtk_main_quit (); } +static gboolean +start_pipeline (gpointer user_data) +{ + GstElement *pipeline = GST_ELEMENT (user_data); + GstStateChangeReturn sret; + + sret = gst_element_set_state (pipeline, GST_STATE_PLAYING); + if (sret == GST_STATE_CHANGE_FAILURE) { + gst_element_set_state (pipeline, GST_STATE_NULL); + gst_object_unref (pipeline); + gtk_main_quit (); + } + return FALSE; +} + int main (int argc, char **argv) { @@ -233,13 +248,9 @@ main (int argc, char **argv) /* show the gui and play */ gtk_widget_show_all (window); - sret = gst_element_set_state (pipeline, GST_STATE_PLAYING); - if (sret == GST_STATE_CHANGE_FAILURE) { - gst_element_set_state (pipeline, GST_STATE_NULL); - gst_object_unref (pipeline); - return -1; - } + g_idle_add (start_pipeline, pipeline); gtk_main (); + gst_object_unref (pipeline); return 0; |