From b6f55607d6491691fba47ddbfd5d61a357047c13 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 22 Apr 2009 12:04:36 +0200 Subject: [PATCH] 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. --- tests/examples/streams/stream-status.c | 6 +++--- 1 file 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);