From 1d57ec6a6e9164501a1fe7cb8543d8fc81b73694 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 7 Dec 2010 11:42:15 +0100 Subject: [PATCH] rtspsrc: use _object_ref_sink() when we can --- gst/rtsp/gstrtspsrc.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index dc8655f1cf..0382fc90ea 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -1567,18 +1567,14 @@ again: /* we keep these elements, we configure all in configure_transport when the * server told us to really use the UDP ports. */ - stream->udpsrc[0] = gst_object_ref (udpsrc0); - stream->udpsrc[1] = gst_object_ref (udpsrc1); + stream->udpsrc[0] = gst_object_ref_sink (udpsrc0); + stream->udpsrc[1] = gst_object_ref_sink (udpsrc1); /* keep track of next available port number when we have a range * configured */ if (src->next_port_num != 0) src->next_port_num = tmp_rtcp + 1; - /* they are ours now */ - gst_object_sink (udpsrc0); - gst_object_sink (udpsrc1); - return TRUE; /* ERRORS */ @@ -2611,8 +2607,7 @@ gst_rtspsrc_stream_configure_mcast (GstRTSPSrc * src, GstRTSPStream * stream, goto no_element; /* take ownership */ - gst_object_ref (stream->udpsrc[0]); - gst_object_sink (stream->udpsrc[0]); + gst_object_ref_sink (stream->udpsrc[0]); /* change state */ gst_element_set_state (stream->udpsrc[0], GST_STATE_PAUSED); @@ -2627,8 +2622,7 @@ gst_rtspsrc_stream_configure_mcast (GstRTSPSrc * src, GstRTSPStream * stream, goto no_element; /* take ownership */ - gst_object_ref (stream->udpsrc[1]); - gst_object_sink (stream->udpsrc[1]); + gst_object_ref_sink (stream->udpsrc[1]); gst_element_set_state (stream->udpsrc[1], GST_STATE_PAUSED); }