summaryrefslogtreecommitdiff
path: root/tests/examples/streams/stream-status.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-04-22 12:04:36 +0200
committerWim Taymans <wim@metal.(none)>2009-05-12 00:09:40 +0200
commitb6f55607d6491691fba47ddbfd5d61a357047c13 (patch)
tree550be7349dd3a4956e137f0239d324a7af03b8e7 /tests/examples/streams/stream-status.c
parent5eccc07856f6725a1cd25413cf7720822342c0cb (diff)
examples: set bus handler before state change
We need to set the bus handler before starting the pipeline or we might just miss the message we are looking for.
Diffstat (limited to 'tests/examples/streams/stream-status.c')
-rw-r--r--tests/examples/streams/stream-status.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/examples/streams/stream-status.c b/tests/examples/streams/stream-status.c
index a9bcc769b4..bc3c6be524 100644
--- a/tests/examples/streams/stream-status.c
+++ b/tests/examples/streams/stream-status.c
@@ -116,13 +116,13 @@ main (int argc, char *argv[])
/* link the elements */
gst_element_link (fakesrc, fakesink);
- /* start playing */
- gst_element_set_state (bin, GST_STATE_PLAYING);
-
/* get the bus, we need to install a sync handler */
bus = gst_pipeline_get_bus (GST_PIPELINE (bin));
gst_bus_set_sync_handler (bus, (GstBusSyncHandler) sync_bus_handler, bin);
+ /* start playing */
+ gst_element_set_state (bin, GST_STATE_PLAYING);
+
/* Run event loop listening for bus messages until EOS or ERROR */
event_loop (bus, bin);