mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 15:51:11 +00:00
udp: make url parsing compatible with VLC syntax
Skip everything before the @ sign in the url location. VLC uses that as the remote address to connect to (but we ignore it for now). This makes our udp urls compatible with the ones used by VLC. Fixes #597695
This commit is contained in:
parent
966ced2208
commit
e25cdc31d3
1 changed files with 13 additions and 5 deletions
|
@ -370,7 +370,7 @@ gst_udp_uri_update (GstUDPUri * uri, const gchar * host, gint port)
|
||||||
int
|
int
|
||||||
gst_udp_parse_uri (const gchar * uristr, GstUDPUri * uri)
|
gst_udp_parse_uri (const gchar * uristr, GstUDPUri * uri)
|
||||||
{
|
{
|
||||||
gchar *protocol;
|
gchar *protocol, *location_start;
|
||||||
gchar *location, *location_end;
|
gchar *location, *location_end;
|
||||||
gchar *colptr;
|
gchar *colptr;
|
||||||
|
|
||||||
|
@ -379,11 +379,19 @@ gst_udp_parse_uri (const gchar * uristr, GstUDPUri * uri)
|
||||||
goto wrong_protocol;
|
goto wrong_protocol;
|
||||||
g_free (protocol);
|
g_free (protocol);
|
||||||
|
|
||||||
location = gst_uri_get_location (uristr);
|
location_start = gst_uri_get_location (uristr);
|
||||||
if (!location)
|
if (!location_start)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
GST_DEBUG ("got location '%s'", location);
|
GST_DEBUG ("got location '%s'", location_start);
|
||||||
|
|
||||||
|
/* VLC compatibility, strip everything before the @ sign. VLC uses that as the
|
||||||
|
* remote address. */
|
||||||
|
location = g_strstr_len (location_start, -1, "@");
|
||||||
|
if (location == NULL)
|
||||||
|
location = location_start;
|
||||||
|
else
|
||||||
|
location += 1;
|
||||||
|
|
||||||
if (location[0] == '[') {
|
if (location[0] == '[') {
|
||||||
GST_DEBUG ("parse IPV6 address '%s'", location);
|
GST_DEBUG ("parse IPV6 address '%s'", location);
|
||||||
|
@ -412,7 +420,7 @@ gst_udp_parse_uri (const gchar * uristr, GstUDPUri * uri)
|
||||||
if (colptr != NULL) {
|
if (colptr != NULL) {
|
||||||
uri->port = atoi (colptr + 1);
|
uri->port = atoi (colptr + 1);
|
||||||
}
|
}
|
||||||
g_free (location);
|
g_free (location_start);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue