diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2008-09-23 18:08:56 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2008-09-23 18:08:56 +0000 |
commit | bf8777356bd15858d69d520b7134f20eeeded01c (patch) | |
tree | 0ce6e70e36850a9234617e9aa926673a203a2a89 /gst/rtsp | |
parent | 34a8fa06f98690d716dc3cf94248de7be93f1508 (diff) |
gst/rtsp/gstrtspsrc.c: Handle the case where we cannot do desribe or when the describe result does not contain a vali...
Original commit message from CVS:
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_open):
Handle the case where we cannot do desribe or when the describe result
does not contain a valid SDP message.
Diffstat (limited to 'gst/rtsp')
-rw-r--r-- | gst/rtsp/gstrtspsrc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index f393697a..c2266ab8 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -3365,6 +3365,7 @@ handle_request_failed: * @src: the rtsp source * @request: must point to a valid request * @response: must point to an empty #GstRTSPMessage + * @code: an optional code result * * send @request and retrieve the response in @response. optionally @code can be * non-NULL in which case it will contain the status code of the response. @@ -4110,6 +4111,10 @@ restart: goto restart; } + /* it could be that the DESCRIBE method was not implemented */ + if (!src->methods & GST_RTSP_DESCRIBE) + goto no_describe; + /* check if reply is SDP */ gst_rtsp_message_get_header (&response, GST_RTSP_HDR_CONTENT_TYPE, &respcont, 0); @@ -4123,6 +4128,9 @@ restart: /* get message body and parse as SDP */ gst_rtsp_message_get_body (&response, &data, &size); + if (data == NULL) + goto no_describe; + GST_DEBUG_OBJECT (src, "parse SDP..."); gst_sdp_message_init (&sdp); gst_sdp_message_parse_buffer (data, size, &sdp); @@ -4214,8 +4222,15 @@ wrong_content_type: ("Server does not support SDP, got %s.", respcont)); goto cleanup_error; } +no_describe: + { + GST_ELEMENT_ERROR (src, RESOURCE, SETTINGS, (NULL), + ("Server can not provide an SDP.")); + goto cleanup_error; + } setup_failed: { + gst_rtspsrc_close (src); /* error was posted */ goto cleanup_error; } |