input/alsa: use StringAfterPrefix()
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user