aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-19 21:39:12 +0200
committerMax Kellermann <max@duempel.org>2014-08-19 21:39:12 +0200
commitd87cf5146e8c64907a0c3ee6f3f36745163c295c (patch)
treeb67cac8d29deaf3c63eb3cebf315efb9ea011f66
parent87eb5cbced0fc0c6646e0f9b4b78f649b9f84831 (diff)
downloadmpd-d87cf5146e8c64907a0c3ee6f3f36745163c295c.tar.gz
mpd-d87cf5146e8c64907a0c3ee6f3f36745163c295c.tar.xz
mpd-d87cf5146e8c64907a0c3ee6f3f36745163c295c.zip
InputStream: CheapSeeking() returns false only for HTTP
Seeking on NFS or SMB is cheap. Actually, only HTTP streams are expensive to seek. This enables a few features on NFS/SMB files, for example Ogg tags.
-rw-r--r--src/input/InputStream.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/input/InputStream.cxx b/src/input/InputStream.cxx
index e73cf75e7..f5efe8ef1 100644
--- a/src/input/InputStream.cxx
+++ b/src/input/InputStream.cxx
@@ -20,7 +20,7 @@
#include "config.h"
#include "InputStream.hxx"
#include "thread/Cond.hxx"
-#include "util/UriUtil.hxx"
+#include "util/StringUtil.hxx"
#include <assert.h>
@@ -76,7 +76,8 @@ gcc_pure
static bool
ExpensiveSeeking(const char *uri)
{
- return uri_has_scheme(uri);
+ return StringStartsWith(uri, "http://") ||
+ StringStartsWith(uri, "https://");
}
bool