tests: multifile: handle FIXME for proper checking when test finished

Use a GstBus and wait for EOS to finish the tests instead of
relying on sleeping
This commit is contained in:
Thiago Santos 2015-03-30 12:51:35 -03:00
parent e00f0de4f3
commit 4bba05339c

View file

@ -33,11 +33,22 @@
static void
run_pipeline (GstElement * pipeline)
{
GstMessage *msg;
GstBus *bus;
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
gst_element_set_state (pipeline, GST_STATE_PAUSED);
gst_element_get_state (pipeline, NULL, NULL, -1);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
/* FIXME too lazy */
g_usleep (1000000);
msg =
gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
GST_MESSAGE_EOS | GST_MESSAGE_ERROR);
fail_unless (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_EOS);
gst_message_unref (msg);
gst_object_unref (bus);
gst_element_set_state (pipeline, GST_STATE_NULL);
}