From: Aaron Boxer Date: Fri, 6 Dec 2019 17:34:15 +0000 (-0500) Subject: rtspsrc: append aggregate control string to base URL before query string X-Git-Tag: 1.19.3~509^2~781 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed6b5a3a632807ea00ae7c609f0c0bed69a9078e;p=platform%2Fupstream%2Fgstreamer.git rtspsrc: append aggregate control string to base URL before query string Appending control string to end of query changes meaning of query string Fixes #650 --- diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 2eb18de746..dacb84aa19 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -2300,21 +2300,28 @@ gst_rtspsrc_create_stream (GstRTSPSrc * src, GstSDPMessage * sdp, gint idx, if (g_str_has_prefix (control_url, "rtsp://")) stream->conninfo.location = g_strdup (control_url); else { - const gchar *base; - gboolean has_slash; - if (g_strcmp0 (control_url, "*") == 0) control_url = ""; + /* handle url with query */ + if (src->conninfo.url && src->conninfo.url->query) { + stream->conninfo.location = + gst_rtsp_url_get_request_uri_with_control (src->conninfo.url, + control_url); + } else { + const gchar *base; + gboolean has_slash; - base = get_aggregate_control (src); + base = get_aggregate_control (src); - /* check if the base ends or control starts with / */ - has_slash = g_str_has_prefix (control_url, "/"); - has_slash = has_slash || g_str_has_suffix (base, "/"); + /* check if the base ends or control starts with / */ + has_slash = g_str_has_prefix (control_url, "/"); + has_slash = has_slash || g_str_has_suffix (base, "/"); - /* concatenate the two strings, insert / when not present */ - stream->conninfo.location = - g_strdup_printf ("%s%s%s", base, has_slash ? "" : "/", control_url); + /* concatenate the two strings, insert / when not present */ + stream->conninfo.location = + g_strdup_printf ("%s%s%s", base, has_slash ? "" : "/", control_url); + + } } } GST_DEBUG_OBJECT (src, " setup: %s",