summaryrefslogtreecommitdiff
path: root/src/playlist/SoundCloudPlaylistPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-07 09:40:31 +0100
committerMax Kellermann <max@duempel.org>2014-01-07 09:40:31 +0100
commit442dadd6fe5c4bab90848b233a560c02f8f63a09 (patch)
tree9e8d84c0210c2ff20908279b6130e702daadc786 /src/playlist/SoundCloudPlaylistPlugin.cxx
parentda9dd58f34469ff9285233d694d43c2e078461ad (diff)
playlist/soundcloud: change scheme check to assertion
The MPD core takes care for checking the scheme.
Diffstat (limited to 'src/playlist/SoundCloudPlaylistPlugin.cxx')
-rw-r--r--src/playlist/SoundCloudPlaylistPlugin.cxx20
1 files changed, 2 insertions, 18 deletions
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/",