aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-11-06 09:35:42 +0100
committerMax Kellermann <max@duempel.org>2015-11-06 09:49:22 +0100
commit3dc989bccb396daf87c2b3791079e5ba92b5aba4 (patch)
tree9608909e50d1e18f4dadbf26dca6bd35a50592b0
parent75d46efd235b2848f77a2d92013d3b4722a0dbeb (diff)
downloadmpd-3dc989bccb396daf87c2b3791079e5ba92b5aba4.tar.gz
mpd-3dc989bccb396daf87c2b3791079e5ba92b5aba4.tar.xz
mpd-3dc989bccb396daf87c2b3791079e5ba92b5aba4.zip
input/alsa: use StringAfterPrefix()
-rw-r--r--src/input/plugins/AlsaInputPlugin.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/input/plugins/AlsaInputPlugin.cxx b/src/input/plugins/AlsaInputPlugin.cxx
index f39574e43..da08a7c5d 100644
--- a/src/input/plugins/AlsaInputPlugin.cxx
+++ b/src/input/plugins/AlsaInputPlugin.cxx
@@ -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;