Commit 3dc989bc authored by Max Kellermann's avatar Max Kellermann

input/alsa: use StringAfterPrefix()

parent 75d46efd
...@@ -159,11 +159,10 @@ inline InputStream * ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment