diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2016-02-28 13:01:34 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2016-04-06 11:31:23 +0100 |
commit | 3c1e93ff885e2dbfb5a1c7772e3a8d545e9fc9cd (patch) | |
tree | 81aeb3b18614e207d2feabb55e76dd979d70e552 | |
parent | 804f04be73662e11b2ae968d46ac43e959da431d (diff) | |
download | gstreamer-plugins-good-3c1e93ff885e2dbfb5a1c7772e3a8d545e9fc9cd.tar.gz |
rtspsrc: Properly error out if binding the UDP sockets fails
udpsrc is not returning us a socket in that case.
-rw-r--r-- | gst/rtsp/gstrtspsrc.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 8c81bc9de..09a732071 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -4024,6 +4024,9 @@ gst_rtspsrc_stream_configure_udp_sinks (GstRTSPSrc * src, /* configure socket, we give it the same UDP socket as the udpsrc for RTP * so that NAT firewalls will open a hole for us */ g_object_get (G_OBJECT (stream->udpsrc[0]), "used-socket", &socket, NULL); + if (!socket) + goto no_socket; + GST_DEBUG_OBJECT (src, "RTP UDP src has sock %p", socket); /* configure socket and make sure udpsink does not close it when shutting * down, it belongs to udpsrc after all. */ @@ -4079,6 +4082,9 @@ gst_rtspsrc_stream_configure_udp_sinks (GstRTSPSrc * src, * because some servers check the port number of where it sends RTCP to identify * the RTCP packets it receives */ g_object_get (G_OBJECT (stream->udpsrc[1]), "used-socket", &socket, NULL); + if (!socket) + goto no_socket; + GST_DEBUG_OBJECT (src, "RTCP UDP src has sock %p", socket); /* configure socket and make sure udpsink does not close it when shutting * down, it belongs to udpsrc after all. */ @@ -4116,17 +4122,22 @@ gst_rtspsrc_stream_configure_udp_sinks (GstRTSPSrc * src, /* ERRORS */ no_destination: { - GST_DEBUG_OBJECT (src, "no destination address specified"); + GST_ERROR_OBJECT (src, "no destination address specified"); return FALSE; } no_sink_element: { - GST_DEBUG_OBJECT (src, "no UDP sink element found"); + GST_ERROR_OBJECT (src, "no UDP sink element found"); return FALSE; } no_fakesrc_element: { - GST_DEBUG_OBJECT (src, "no fakesrc element found"); + GST_ERROR_OBJECT (src, "no fakesrc element found"); + return FALSE; + } +no_socket: + { + GST_ERROR_OBJECT (src, "failed to create socket"); return FALSE; } } |