gst/rtsp/gstrtspsrc.c: Post the server response code in an error message instead of a generic 'error' message. Fixes ...

Original commit message from CVS:
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_setup_streams):
Post the server response code in an error message instead of a generic
'error' message. Fixes #517237.
This commit is contained in:
Wim Taymans 2008-02-22 09:56:03 +00:00
parent e63b9b56bf
commit 7f0745bb7f
2 changed files with 16 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2008-02-22 Wim Taymans <wim.taymans@collabora.co.uk>
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_setup_streams):
Post the server response code in an error message instead of a generic
'error' message. Fixes #517237.
2008-02-22 Sebastian Dröge <slomo@circular-chaos.org> 2008-02-22 Sebastian Dröge <slomo@circular-chaos.org>
* tests/check/Makefile.am: * tests/check/Makefile.am:

View file

@ -3571,6 +3571,7 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src)
GstRTSPMessage response = { 0 }; GstRTSPMessage response = { 0 };
GstRTSPStream *stream = NULL; GstRTSPStream *stream = NULL;
GstRTSPLowerTrans protocols; GstRTSPLowerTrans protocols;
GstRTSPStatusCode code;
/* we initially allow all configured lower transports. based on the URL /* we initially allow all configured lower transports. based on the URL
* transports and the replies from the server we narrow them down. */ * transports and the replies from the server we narrow them down. */
@ -3586,7 +3587,6 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src)
for (walk = src->streams; walk; walk = g_list_next (walk)) { for (walk = src->streams; walk; walk = g_list_next (walk)) {
gchar *transports; gchar *transports;
GstRTSPStatusCode code;
stream = (GstRTSPStream *) walk->data; stream = (GstRTSPStream *) walk->data;
@ -3663,7 +3663,7 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src)
gst_rtspsrc_stream_free_udp (stream); gst_rtspsrc_stream_free_udp (stream);
continue; continue;
default: default:
goto send_error; goto response_error;
} }
/* parse response transport */ /* parse response transport */
@ -3764,6 +3764,14 @@ setup_transport_failed:
("Could not setup transport.")); ("Could not setup transport."));
goto cleanup_error; goto cleanup_error;
} }
response_error:
{
const gchar *str = gst_rtsp_status_as_text (code);
GST_ELEMENT_ERROR (src, RESOURCE, WRITE, (NULL),
("Error (%d): %s", code, GST_STR_NULL (str)));
goto cleanup_error;
}
send_error: send_error:
{ {
gchar *str = gst_rtsp_strresult (res); gchar *str = gst_rtsp_strresult (res);