From: Wim Taymans Date: Tue, 6 Jul 2010 16:22:24 +0000 (+0200) Subject: rtspsrc: don't reuse udp sockets X-Git-Tag: RELEASE-0.10.25~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9dcfed0a5b0bf24cec0bcf13fc1a9e3c355522f1;p=platform%2Fupstream%2Fgst-plugins-good.git rtspsrc: don't reuse udp sockets Don't reuse sockets but make the udpsrc element fail the state change when the socket is already in use. If we don't prevent reuse, we might end up using the same port for different streams in some cases. Fixes #622017 --- diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 855cf8652..5a731405e 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -1441,7 +1441,7 @@ again: udpsrc0 = gst_element_make_from_uri (GST_URI_SRC, host, NULL); if (udpsrc0 == NULL) goto no_udp_protocol; - g_object_set (G_OBJECT (udpsrc0), "port", tmp_rtp, NULL); + g_object_set (G_OBJECT (udpsrc0), "port", tmp_rtp, "reuse", FALSE, NULL); ret = gst_element_set_state (udpsrc0, GST_STATE_PAUSED); if (ret == GST_STATE_CHANGE_FAILURE) { @@ -1492,7 +1492,7 @@ again: if (src->client_port_range.max > 0 && tmp_rtcp >= src->client_port_range.max) goto no_ports; - g_object_set (G_OBJECT (udpsrc1), "port", tmp_rtcp, NULL); + g_object_set (G_OBJECT (udpsrc1), "port", tmp_rtcp, "reuse", FALSE, NULL); GST_DEBUG_OBJECT (src, "starting RTCP on port %d", tmp_rtcp); ret = gst_element_set_state (udpsrc1, GST_STATE_PAUSED);