diff options
author | Max Kellermann <max@duempel.org> | 2013-11-28 18:48:35 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-11-28 18:48:35 +0100 |
commit | af4133e3c92c78cc19ff14b876be6afcab1db091 (patch) | |
tree | da38387995bde630b20f81a717862ae21d19bb48 /src/input/FfmpegInputPlugin.cxx | |
parent | a788b7e747bc21b9aadee45dd028fa6198af794e (diff) | |
download | mpd-af4133e3c92c78cc19ff14b876be6afcab1db091.tar.gz mpd-af4133e3c92c78cc19ff14b876be6afcab1db091.tar.xz mpd-af4133e3c92c78cc19ff14b876be6afcab1db091.zip |
Util/StringUtil: add StringStartsWith()
Replaces GLib's g_str_has_prefix().
Diffstat (limited to '')
-rw-r--r-- | src/input/FfmpegInputPlugin.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/input/FfmpegInputPlugin.cxx b/src/input/FfmpegInputPlugin.cxx index c6f4afb7f..7d041677b 100644 --- a/src/input/FfmpegInputPlugin.cxx +++ b/src/input/FfmpegInputPlugin.cxx @@ -24,6 +24,7 @@ #include "FfmpegInputPlugin.hxx" #include "InputStream.hxx" #include "InputPlugin.hxx" +#include "util/StringUtil.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" @@ -32,8 +33,6 @@ extern "C" { #include <libavformat/avformat.h> } -#include <glib.h> - struct FfmpegInputStream { InputStream base; @@ -90,12 +89,12 @@ input_ffmpeg_open(const char *uri, Mutex &mutex, Cond &cond, Error &error) { - if (!g_str_has_prefix(uri, "gopher://") && - !g_str_has_prefix(uri, "rtp://") && - !g_str_has_prefix(uri, "rtsp://") && - !g_str_has_prefix(uri, "rtmp://") && - !g_str_has_prefix(uri, "rtmpt://") && - !g_str_has_prefix(uri, "rtmps://")) + if (!StringStartsWith(uri, "gopher://") && + !StringStartsWith(uri, "rtp://") && + !StringStartsWith(uri, "rtsp://") && + !StringStartsWith(uri, "rtmp://") && + !StringStartsWith(uri, "rtmpt://") && + !StringStartsWith(uri, "rtmps://")) return nullptr; AVIOContext *h; |