aboutsummaryrefslogtreecommitdiffstats
path: root/src/input_stream.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-07 23:23:58 +0100
committerMax Kellermann <max@duempel.org>2013-01-07 23:25:08 +0100
commit960b9a966450f4870a14c81170e3b625f9c13a8a (patch)
tree1066a84c6825aea6f61bf9db8fdf4e54c8f66144 /src/input_stream.c
parentacb45caa4205d6e07c46b14079a7ffe0a2141d3d (diff)
downloadmpd-960b9a966450f4870a14c81170e3b625f9c13a8a.tar.gz
mpd-960b9a966450f4870a14c81170e3b625f9c13a8a.tar.xz
mpd-960b9a966450f4870a14c81170e3b625f9c13a8a.zip
input_stream: add method _cheap_seeking()
Move code from the Vorbis decoder plugin.
Diffstat (limited to 'src/input_stream.c')
-rw-r--r--src/input_stream.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/input_stream.c b/src/input_stream.c
index e445dca6c..c82788f39 100644
--- a/src/input_stream.c
+++ b/src/input_stream.c
@@ -22,6 +22,7 @@
#include "input_registry.h"
#include "input_plugin.h"
#include "input/rewind_input_plugin.h"
+#include "uri.h"
#include <glib.h>
#include <assert.h>
@@ -115,6 +116,12 @@ input_stream_lock_wait_ready(struct input_stream *is)
}
bool
+input_stream_cheap_seeking(const struct input_stream *is)
+{
+ return is->seekable && (is->uri == NULL || !uri_has_scheme(is->uri));
+}
+
+bool
input_stream_seek(struct input_stream *is, goffset offset, int whence,
GError **error_r)
{