[farsight2/master] Remove src from the bin before stopping it (before of the lost states)

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


---
 transmitters/rawudp/fs-rawudp-transmitter.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/transmitters/rawudp/fs-rawudp-transmitter.c b/transmitters/rawudp/fs-rawudp-transmitter.c
index ee46d3f..39ada03 100644
--- a/transmitters/rawudp/fs-rawudp-transmitter.c
+++ b/transmitters/rawudp/fs-rawudp-transmitter.c
@@ -666,11 +666,13 @@ fs_rawudp_transmitter_put_udpport (FsRawUdpTransmitter *trans,
 
   if (udpport->udpsrc) {
     GstStateChangeReturn ret;
+    gst_object_ref (udpport->udpsrc);
+    gst_bin_remove (GST_BIN (trans->priv->gst_src), udpport->udpsrc);
     ret = gst_element_set_state (udpport->udpsrc, GST_STATE_NULL);
     if (ret != GST_STATE_CHANGE_SUCCESS) {
       g_warning ("Error changing state of udpsrc: %d", ret);
     }
-    gst_bin_remove (GST_BIN (trans->priv->gst_src), udpport->udpsrc);
+    gst_object_unref (udpport->udpsrc);
   }
 
   if (udpport->udpsrc_requested_pad) {
-- 
1.5.6.5




More information about the farsight-commits mailing list