mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-06 10:42:22 +00:00
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:
parent
e00f0de4f3
commit
4bba05339c
1 changed files with 13 additions and 2 deletions
|
@ -33,11 +33,22 @@
|
||||||
static void
|
static void
|
||||||
run_pipeline (GstElement * pipeline)
|
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_set_state (pipeline, GST_STATE_PAUSED);
|
||||||
gst_element_get_state (pipeline, NULL, NULL, -1);
|
gst_element_get_state (pipeline, NULL, NULL, -1);
|
||||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
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);
|
gst_element_set_state (pipeline, GST_STATE_NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue