From 4bba05339cd10d817854d0dc5f2f2e332ba5790d Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Mon, 30 Mar 2015 12:51:35 -0300 Subject: [PATCH] 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 --- tests/check/elements/multifile.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/check/elements/multifile.c b/tests/check/elements/multifile.c index 20770bb8fd..7a8e9024ce 100644 --- a/tests/check/elements/multifile.c +++ b/tests/check/elements/multifile.c @@ -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); }