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,
Error &error)
{
const char *const scheme = "alsa://";
if (!StringStartsWith(uri, scheme))
const char *device = StringAfterPrefix(uri, "alsa://");
if (device == nullptr)
return nullptr;
const char *device = uri + strlen(scheme);
if (*device == 0)
device = default_device;