From 9dcfed0a5b0bf24cec0bcf13fc1a9e3c355522f1 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 6 Jul 2010 18:22:24 +0200 Subject: [PATCH] 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 --- gst/rtsp/gstrtspsrc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 855cf8652b..5a731405e1 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);