From 442dadd6fe5c4bab90848b233a560c02f8f63a09 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 7 Jan 2014 09:40:31 +0100 Subject: playlist/soundcloud: change scheme check to assertion The MPD core takes care for checking the scheme. --- src/playlist/SoundCloudPlaylistPlugin.cxx | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/playlist/SoundCloudPlaylistPlugin.cxx b/src/playlist/SoundCloudPlaylistPlugin.cxx index 68262fccb..716e2d6fb 100644 --- a/src/playlist/SoundCloudPlaylistPlugin.cxx +++ b/src/playlist/SoundCloudPlaylistPlugin.cxx @@ -322,18 +322,10 @@ soundcloud_parse_json(const char *url, yajl_handle hand, static SongEnumerator * soundcloud_open_uri(const char *uri, Mutex &mutex, Cond &cond) { - char *s = g_strdup(uri); - char *scheme = s; + assert(memcmp(uri, "soundcloud://", 13) == 0); + char *const s = g_strdup(uri + 13); char *p = s; - for (; *p; p++) { - if (*p == ':' && *(p+1) == '/' && *(p+2) == '/') { - *p = 0; - p += 3; - break; - } - } - char *arg = p; for (; *p; p++) { if (*p == '/') { @@ -345,14 +337,6 @@ soundcloud_open_uri(const char *uri, Mutex &mutex, Cond &cond) char *rest = p; - if (strcmp(scheme, "soundcloud") != 0) { - FormatWarning(soundcloud_domain, - "incompatible scheme for soundcloud plugin: %s", - scheme); - g_free(s); - return nullptr; - } - char *u = nullptr; if (strcmp(arg, "track") == 0) { u = g_strconcat("https://api.soundcloud.com/tracks/", -- cgit v1.2.3