mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
rtspsrc: Properly error out if SDP contains no streams
Also fixes unitialized variable error on macosx.
This commit is contained in:
parent
26993420c0
commit
d08e0ccc48
1 changed files with 10 additions and 1 deletions
|
@ -5000,7 +5000,7 @@ static GstRTSPResult
|
|||
gst_rtspsrc_setup_streams (GstRTSPSrc * src, gboolean async)
|
||||
{
|
||||
GList *walk;
|
||||
GstRTSPResult res;
|
||||
GstRTSPResult res = GST_RTSP_ERROR;
|
||||
GstRTSPMessage request = { 0 };
|
||||
GstRTSPMessage response = { 0 };
|
||||
GstRTSPStream *stream = NULL;
|
||||
|
@ -5032,6 +5032,9 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src, gboolean async)
|
|||
src->next_port_num = src->client_port_range.min;
|
||||
rtpport = rtcpport = 0;
|
||||
|
||||
if (G_UNLIKELY (src->streams == NULL))
|
||||
goto no_streams;
|
||||
|
||||
for (walk = src->streams; walk; walk = g_list_next (walk)) {
|
||||
GstRTSPConnection *conn;
|
||||
gchar *transports;
|
||||
|
@ -5284,6 +5287,12 @@ no_protocols:
|
|||
("Could not connect to server, no protocols left"));
|
||||
return GST_RTSP_ERROR;
|
||||
}
|
||||
no_streams:
|
||||
{
|
||||
GST_ELEMENT_ERROR (src, RESOURCE, SETTINGS, (NULL),
|
||||
("SDP contains no streams"));
|
||||
return GST_RTSP_ERROR;
|
||||
}
|
||||
create_request_failed:
|
||||
{
|
||||
gchar *str = gst_rtsp_strresult (res);
|
||||
|
|
Loading…
Reference in a new issue