diff options
author | Bastien Nocera <hadess@hadess.net> | 2012-04-11 12:42:17 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-04-23 15:34:54 +0200 |
commit | 933986fccc0b7dad57636bd8ff9ec64f17f8e855 (patch) | |
tree | 338b8085a1f727edb962d876ce1414394892bade /ext/soup | |
parent | 8719375be7a6be072eb8641eae44e2c2f8b330c9 (diff) |
soup: Handle icy and icyx URI schemes
As handled by QuickTime (for icy), and Orban/Coding Technologies
AAC/aacPlus Player (for icyx). See also:
https://bugzilla.gnome.org/show_bug.cgi?id=394207
https://bugzilla.gnome.org/show_bug.cgi?id=403285
https://bugzilla.gnome.org/show_bug.cgi?id=673899
Diffstat (limited to 'ext/soup')
-rw-r--r-- | ext/soup/gstsouphttpsrc.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/soup/gstsouphttpsrc.c b/ext/soup/gstsouphttpsrc.c index 8c84d67e2..e35e39a51 100644 --- a/ext/soup/gstsouphttpsrc.c +++ b/ext/soup/gstsouphttpsrc.c @@ -1362,10 +1362,25 @@ static gboolean gst_soup_http_src_set_location (GstSoupHTTPSrc * src, const gchar * uri, GError ** error) { + const char *alt_schemes[] = { "icy://", "icyx://" }; + guint i; + if (src->location) { g_free (src->location); src->location = NULL; } + + if (uri == NULL) + return FALSE; + + for (i = 0; i < G_N_ELEMENTS (alt_schemes); i++) { + if (g_str_has_prefix (uri, alt_schemes[i])) { + src->location = + g_strdup_printf ("http://%s", uri + strlen (alt_schemes[i])); + return TRUE; + } + } + src->location = g_strdup (uri); return TRUE; @@ -1399,7 +1414,7 @@ gst_soup_http_src_uri_get_type (GType type) static const gchar *const * gst_soup_http_src_uri_get_protocols (GType type) { - static const gchar *protocols[] = { "http", "https", NULL }; + static const gchar *protocols[] = { "http", "https", "icy", "icyx", NULL }; return protocols; } |