gst/rtsp/gstrtspsrc.c: Don't crash when an unsupported transport error was returned by the server, just try to config...

Original commit message from CVS:
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_setup_streams):
Don't crash when an unsupported transport error was returned by the
server, just try to configure the next stream. Fixes #439255.
This commit is contained in:
Wim Taymans 2007-05-18 13:27:39 +00:00
parent e04f7a828f
commit fc99abef7f
2 changed files with 21 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2007-05-18 Wim Taymans <wim@fluendo.com>
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_setup_streams):
Don't crash when an unsupported transport error was returned by the
server, just try to configure the next stream. Fixes #439255.
2007-05-18 Wim Taymans <wim@fluendo.com> 2007-05-18 Wim Taymans <wim@fluendo.com>
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_class_init), * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_class_init),

View file

@ -3126,6 +3126,9 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src)
* transports and the replies from the server we narrow them down. */ * transports and the replies from the server we narrow them down. */
protocols = src->url->transports & src->cur_protocols; protocols = src->url->transports & src->cur_protocols;
if (protocols == 0)
goto no_protocols;
/* reset some state */ /* reset some state */
src->free_channel = 0; src->free_channel = 0;
src->interleaved = FALSE; src->interleaved = FALSE;
@ -3202,9 +3205,11 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src)
case RTSP_STS_OK: case RTSP_STS_OK:
break; break;
case RTSP_STS_UNSUPPORTED_TRANSPORT: case RTSP_STS_UNSUPPORTED_TRANSPORT:
/* cleanup of leftover transport */ rtsp_message_unset (&request);
rtsp_message_unset (&response);
/* cleanup of leftover transport and move to the next stream */
gst_rtspsrc_stream_free_udp (stream); gst_rtspsrc_stream_free_udp (stream);
goto next_stream; continue;
default: default:
goto send_error; goto send_error;
} }
@ -3218,7 +3223,7 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src)
if (!resptrans) if (!resptrans)
goto no_transport; goto no_transport;
/* parse transport */ /* parse transport, go to next stream on parse error */
if (rtsp_transport_parse (resptrans, &transport) != RTSP_OK) if (rtsp_transport_parse (resptrans, &transport) != RTSP_OK)
continue; continue;
@ -3261,7 +3266,6 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src)
stream); stream);
} }
} }
next_stream:
/* clean up our transport struct */ /* clean up our transport struct */
rtsp_transport_init (&transport); rtsp_transport_init (&transport);
} }
@ -3275,6 +3279,13 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src)
return TRUE; return TRUE;
/* ERRORS */ /* ERRORS */
no_protocols:
{
/* no transport possible, post an error and stop */
GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
("Could not connect to server, no protocols left"));
return FALSE;
}
create_request_failed: create_request_failed:
{ {
gchar *str = rtsp_strresult (res); gchar *str = rtsp_strresult (res);