aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-19 21:38:18 +0200
committerMax Kellermann <max@duempel.org>2014-08-19 21:38:18 +0200
commit87eb5cbced0fc0c6646e0f9b4b78f649b9f84831 (patch)
tree8ee175a515d446a4f1c4e1f2b4ab622f31f7f343 /src
parent181edf4b5397ded0bb49b13a9df0a21b1806a695 (diff)
downloadmpd-87eb5cbced0fc0c6646e0f9b4b78f649b9f84831.tar.gz
mpd-87eb5cbced0fc0c6646e0f9b4b78f649b9f84831.tar.xz
mpd-87eb5cbced0fc0c6646e0f9b4b78f649b9f84831.zip
InputStream: move code to ExpensiveSeeking()
Diffstat (limited to '')
-rw-r--r--src/input/InputStream.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/input/InputStream.cxx b/src/input/InputStream.cxx
index 657b9df09..e73cf75e7 100644
--- a/src/input/InputStream.cxx
+++ b/src/input/InputStream.cxx
@@ -67,10 +67,22 @@ InputStream::LockWaitReady()
WaitReady();
}
+/**
+ * Is seeking on resources behind this URI "expensive"? For example,
+ * seeking in a HTTP file requires opening a new connection with a new
+ * HTTP request.
+ */
+gcc_pure
+static bool
+ExpensiveSeeking(const char *uri)
+{
+ return uri_has_scheme(uri);
+}
+
bool
InputStream::CheapSeeking() const
{
- return IsSeekable() && !uri_has_scheme(uri.c_str());
+ return IsSeekable() && !ExpensiveSeeking(uri.c_str());
}
bool