Commit 970e6355 authored by Muhammet Ilendemli's avatar Muhammet Ilendemli Committed by Tim-Philipp Müller

rtsp-client: Generate correct URI for MIKEY in ANNOUNCE responses

Instead of hardcoding the URI, take the actual URI (and especially the correct port)
from the RTSP context.

Fixes #84
parent 491631a6
Pipeline #71459 passed with stages
in 42 minutes and 37 seconds
......@@ -3091,16 +3091,18 @@ handle_announce_request (GstRTSPClient * client, GstRTSPContext * ctx)
n_streams = gst_rtsp_media_n_streams (media);
for (i = 0; i < n_streams; i++) {
GstRTSPStream *stream = gst_rtsp_media_get_stream (media, i);
gchar *location =
g_strdup_printf ("rtsp://%s%s:8554/stream=%d", priv->server_ip, path,
i);
gchar *keymgmt = stream_make_keymgmt (client, location, stream);
gchar *uri, *location, *keymgmt;
uri = gst_rtsp_url_get_request_uri (ctx->uri);
location = g_strdup_printf ("%s/stream=%d", uri, i);
keymgmt = stream_make_keymgmt (client, location, stream);
if (keymgmt)
gst_rtsp_message_take_header (ctx->response, GST_RTSP_HDR_KEYMGMT,
keymgmt);
g_free (location);
g_free (uri);
}
/* we suspend after the announce */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment