[gst-cvs] gstreamer: examples: set bus handler before state change
Wim Taymans
wtay at kemper.freedesktop.org
Mon May 11 15:19:57 PDT 2009
Module: gstreamer
Branch: master
Commit: b6f55607d6491691fba47ddbfd5d61a357047c13
URL: http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=b6f55607d6491691fba47ddbfd5d61a357047c13
Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date: Wed Apr 22 12:04:36 2009 +0200
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 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/examples/streams/stream-status.c b/tests/examples/streams/stream-status.c
index a9bcc76..bc3c6be 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);
More information about the Gstreamer-commits
mailing list