mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-01 03:52:25 +00:00
rtspsrc: update rtsp url on redirect
- If a redirect took place on a GET when rtsp is tunneled we update the rtsp url too. - log source and final destination on redirect Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5222>
This commit is contained in:
parent
13c5406747
commit
0a55c86e6a
1 changed files with 16 additions and 2 deletions
|
@ -5351,6 +5351,8 @@ gst_rtsp_conninfo_connect (GstRTSPSrc * src, GstRTSPConnInfo * info,
|
|||
GstRTSPResult res;
|
||||
GstRTSPMessage response;
|
||||
gboolean retry = FALSE;
|
||||
GstRTSPUrl *url;
|
||||
gchar *new_url;
|
||||
memset (&response, 0, sizeof (response));
|
||||
gst_rtsp_message_init (&response);
|
||||
do {
|
||||
|
@ -5431,7 +5433,19 @@ gst_rtsp_conninfo_connect (GstRTSPSrc * src, GstRTSPConnInfo * info,
|
|||
|
||||
if (res == GST_RTSP_OK)
|
||||
info->connected = TRUE;
|
||||
else if (!retry)
|
||||
else if (res == GST_RTSP_OK_REDIRECT) {
|
||||
url = gst_rtsp_connection_get_url (info->connection);
|
||||
|
||||
if (url == NULL || info->url_str == NULL)
|
||||
goto could_not_connect;
|
||||
|
||||
new_url = gst_rtsp_url_get_request_uri (url);
|
||||
GST_DEBUG_OBJECT (src, "redirected from %s to %s", info->url_str,
|
||||
new_url);
|
||||
g_free (info->url_str);
|
||||
info->url_str = new_url;
|
||||
info->connected = TRUE;
|
||||
} else if (!retry)
|
||||
goto could_not_connect;
|
||||
}
|
||||
} while (!info->connected && retry);
|
||||
|
|
Loading…
Reference in a new issue