Commit 2dc5648e authored by Max Kellermann's avatar Max Kellermann

input/CdioParanoia: use StringAfterPrefixIgnoreCase()

parent d0349880
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "../InputStream.hxx" #include "../InputStream.hxx"
#include "../InputPlugin.hxx" #include "../InputPlugin.hxx"
#include "util/TruncateString.hxx" #include "util/TruncateString.hxx"
#include "util/ASCII.hxx" #include "util/StringCompare.hxx"
#include "util/RuntimeError.hxx" #include "util/RuntimeError.hxx"
#include "util/Domain.hxx" #include "util/Domain.hxx"
#include "system/ByteOrder.hxx" #include "system/ByteOrder.hxx"
...@@ -130,11 +130,6 @@ struct cdio_uri { ...@@ -130,11 +130,6 @@ struct cdio_uri {
static bool static bool
parse_cdio_uri(struct cdio_uri *dest, const char *src) parse_cdio_uri(struct cdio_uri *dest, const char *src)
{ {
if (!StringStartsWithCaseASCII(src, "cdda://"))
return false;
src += 7;
if (*src == 0) { if (*src == 0) {
/* play the whole CD in the default drive */ /* play the whole CD in the default drive */
dest->device[0] = 0; dest->device[0] = 0;
...@@ -188,6 +183,9 @@ static InputStreamPtr ...@@ -188,6 +183,9 @@ static InputStreamPtr
input_cdio_open(const char *uri, input_cdio_open(const char *uri,
Mutex &mutex) Mutex &mutex)
{ {
uri = StringAfterPrefixIgnoreCase(uri, "cdda://");
assert(uri != nullptr);
struct cdio_uri parsed_uri; struct cdio_uri parsed_uri;
if (!parse_cdio_uri(&parsed_uri, uri)) if (!parse_cdio_uri(&parsed_uri, uri))
return nullptr; return nullptr;
......
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