input/alsa: use StringAfterPrefix()

This commit is contained in:
Max Kellermann
2015-11-06 09:35:42 +01:00
parent 75d46efd23
commit 3dc989bccb

View File

@@ -159,11 +159,10 @@ inline InputStream *
AlsaInputStream::Create(const char *uri, Mutex &mutex, Cond &cond, AlsaInputStream::Create(const char *uri, Mutex &mutex, Cond &cond,
Error &error) Error &error)
{ {
const char *const scheme = "alsa://"; const char *device = StringAfterPrefix(uri, "alsa://");
if (!StringStartsWith(uri, scheme)) if (device == nullptr)
return nullptr; return nullptr;
const char *device = uri + strlen(scheme);
if (*device == 0) if (*device == 0)
device = default_device; device = default_device;