Merge branch 'v0.20.x'
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
#include "InputStream.hxx"
|
||||
#include "Handler.hxx"
|
||||
#include "tag/Tag.hxx"
|
||||
#include "util/StringCompare.hxx"
|
||||
#include "util/ASCII.hxx"
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
@@ -60,10 +60,10 @@ gcc_pure
|
||||
static bool
|
||||
ExpensiveSeeking(const char *uri) noexcept
|
||||
{
|
||||
return StringStartsWith(uri, "http://") ||
|
||||
StringStartsWith(uri, "tidal://") ||
|
||||
StringStartsWith(uri, "qobuz://") ||
|
||||
StringStartsWith(uri, "https://");
|
||||
return StringStartsWithCaseASCII(uri, "http://") ||
|
||||
StringStartsWithCaseASCII(uri, "tidal://") ||
|
||||
StringStartsWithCaseASCII(uri, "qobuz://") ||
|
||||
StringStartsWithCaseASCII(uri, "https://");
|
||||
}
|
||||
|
||||
bool
|
||||
|
@@ -35,7 +35,7 @@
|
||||
#include "util/RuntimeError.hxx"
|
||||
#include "util/StringCompare.hxx"
|
||||
#include "util/ReusableArray.hxx"
|
||||
|
||||
#include "util/ASCII.hxx"
|
||||
#include "Log.hxx"
|
||||
#include "event/MultiSocketMonitor.hxx"
|
||||
#include "event/DeferEvent.hxx"
|
||||
@@ -150,7 +150,7 @@ inline InputStreamPtr
|
||||
AlsaInputStream::Create(EventLoop &event_loop, const char *uri,
|
||||
Mutex &mutex)
|
||||
{
|
||||
const char *device = StringAfterPrefix(uri, "alsa://");
|
||||
const char *device = StringAfterPrefixCaseASCII(uri, "alsa://");
|
||||
if (device == nullptr)
|
||||
return nullptr;
|
||||
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include "../InputStream.hxx"
|
||||
#include "../InputPlugin.hxx"
|
||||
#include "util/TruncateString.hxx"
|
||||
#include "util/StringCompare.hxx"
|
||||
#include "util/ASCII.hxx"
|
||||
#include "util/RuntimeError.hxx"
|
||||
#include "util/Domain.hxx"
|
||||
#include "system/ByteOrder.hxx"
|
||||
@@ -128,7 +128,7 @@ struct cdio_uri {
|
||||
static bool
|
||||
parse_cdio_uri(struct cdio_uri *dest, const char *src)
|
||||
{
|
||||
if (!StringStartsWith(src, "cdda://"))
|
||||
if (!StringStartsWithCaseASCII(src, "cdda://"))
|
||||
return false;
|
||||
|
||||
src += 7;
|
||||
|
@@ -466,8 +466,8 @@ OpenCurlInputStream(const char *uri,
|
||||
static InputStreamPtr
|
||||
input_curl_open(const char *url, Mutex &mutex)
|
||||
{
|
||||
if (strncmp(url, "http://", 7) != 0 &&
|
||||
strncmp(url, "https://", 8) != 0)
|
||||
if (!StringStartsWithCaseASCII(url, "http://") &&
|
||||
!StringStartsWithCaseASCII(url, "https://"))
|
||||
return nullptr;
|
||||
|
||||
return CurlInputStream::Open(url, {}, mutex);
|
||||
|
@@ -28,7 +28,7 @@
|
||||
#include "../InputStream.hxx"
|
||||
#include "../InputPlugin.hxx"
|
||||
#include "PluginUnavailable.hxx"
|
||||
#include "util/StringCompare.hxx"
|
||||
#include "util/ASCII.hxx"
|
||||
|
||||
extern "C" {
|
||||
#include <libavformat/avio.h>
|
||||
@@ -85,12 +85,12 @@ static InputStreamPtr
|
||||
input_ffmpeg_open(const char *uri,
|
||||
Mutex &mutex)
|
||||
{
|
||||
if (!StringStartsWith(uri, "gopher://") &&
|
||||
!StringStartsWith(uri, "rtp://") &&
|
||||
!StringStartsWith(uri, "rtsp://") &&
|
||||
!StringStartsWith(uri, "rtmp://") &&
|
||||
!StringStartsWith(uri, "rtmpt://") &&
|
||||
!StringStartsWith(uri, "rtmps://"))
|
||||
if (!StringStartsWithCaseASCII(uri, "gopher://") &&
|
||||
!StringStartsWithCaseASCII(uri, "rtp://") &&
|
||||
!StringStartsWithCaseASCII(uri, "rtsp://") &&
|
||||
!StringStartsWithCaseASCII(uri, "rtmp://") &&
|
||||
!StringStartsWithCaseASCII(uri, "rtmpt://") &&
|
||||
!StringStartsWithCaseASCII(uri, "rtmps://"))
|
||||
return nullptr;
|
||||
|
||||
AVIOContext *h;
|
||||
|
@@ -22,7 +22,7 @@
|
||||
#include "input/ThreadInputStream.hxx"
|
||||
#include "input/InputPlugin.hxx"
|
||||
#include "system/Error.hxx"
|
||||
#include "util/StringCompare.hxx"
|
||||
#include "util/ASCII.hxx"
|
||||
|
||||
#include <libmms/mmsx.h>
|
||||
|
||||
@@ -72,10 +72,10 @@ static InputStreamPtr
|
||||
input_mms_open(const char *url,
|
||||
Mutex &mutex)
|
||||
{
|
||||
if (!StringStartsWith(url, "mms://") &&
|
||||
!StringStartsWith(url, "mmsh://") &&
|
||||
!StringStartsWith(url, "mmst://") &&
|
||||
!StringStartsWith(url, "mmsu://"))
|
||||
if (!StringStartsWithCaseASCII(url, "mms://") &&
|
||||
!StringStartsWithCaseASCII(url, "mmsh://") &&
|
||||
!StringStartsWithCaseASCII(url, "mmst://") &&
|
||||
!StringStartsWithCaseASCII(url, "mmsu://"))
|
||||
return nullptr;
|
||||
|
||||
auto m = std::make_unique<MmsInputStream>(url, mutex);
|
||||
|
@@ -23,9 +23,7 @@
|
||||
#include "../InputPlugin.hxx"
|
||||
#include "lib/nfs/Glue.hxx"
|
||||
#include "lib/nfs/FileReader.hxx"
|
||||
#include "util/StringCompare.hxx"
|
||||
|
||||
#include <string.h>
|
||||
#include "util/ASCII.hxx"
|
||||
|
||||
/**
|
||||
* Do not buffer more than this number of bytes. It should be a
|
||||
@@ -219,7 +217,7 @@ static InputStreamPtr
|
||||
input_nfs_open(const char *uri,
|
||||
Mutex &mutex)
|
||||
{
|
||||
if (!StringStartsWith(uri, "nfs://"))
|
||||
if (!StringStartsWithCaseASCII(uri, "nfs://"))
|
||||
return nullptr;
|
||||
|
||||
auto is = std::make_unique<NfsInputStream>(uri, mutex);
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#include "../InputPlugin.hxx"
|
||||
#include "PluginUnavailable.hxx"
|
||||
#include "system/Error.hxx"
|
||||
#include "util/StringCompare.hxx"
|
||||
#include "util/ASCII.hxx"
|
||||
|
||||
#include <libsmbclient.h>
|
||||
|
||||
@@ -87,7 +87,7 @@ static InputStreamPtr
|
||||
input_smbclient_open(const char *uri,
|
||||
Mutex &mutex)
|
||||
{
|
||||
if (!StringStartsWith(uri, "smb://"))
|
||||
if (!StringStartsWithCaseASCII(uri, "smb://"))
|
||||
return nullptr;
|
||||
|
||||
const std::lock_guard<Mutex> protect(smbclient_mutex);
|
||||
|
Reference in New Issue
Block a user