[farsight2/master] Lock source to prevent it being started by the bin before its linked

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:26:42 PST 2008


---
 tests/check/transmitter/generic.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/tests/check/transmitter/generic.c b/tests/check/transmitter/generic.c
index 3f19f24..3f86404 100644
--- a/tests/check/transmitter/generic.c
+++ b/tests/check/transmitter/generic.c
@@ -65,6 +65,12 @@ setup_fakesrc (FsTransmitter *trans, GstElement *pipeline, guint component_id)
       "filltype", 2,
       NULL);
 
+  /*
+   * We lock and unlock the state to prevent the source to start
+   * playing before we link it
+   */
+  gst_element_set_locked_state (src, TRUE);
+
   ts_fail_unless (gst_bin_add (GST_BIN (pipeline), src),
     "Could not add the fakesrc");
 
@@ -78,6 +84,8 @@ setup_fakesrc (FsTransmitter *trans, GstElement *pipeline, guint component_id)
   ts_fail_if (gst_element_set_state (src, GST_STATE_PLAYING) ==
     GST_STATE_CHANGE_FAILURE, "Could not set the fakesrc to playing");
 
+  gst_element_set_locked_state (src, FALSE);
+
   gst_object_unref (trans_sink);
 }
 
-- 
1.5.6.5




More information about the farsight-commits mailing list