aboutsummaryrefslogtreecommitdiffstats
path: root/src/input
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/input_stream.c7
-rw-r--r--src/input_stream.h7
2 files changed, 14 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)
{
diff --git a/src/input_stream.h b/src/input_stream.h
index 3a29625af..d5b1dae2e 100644
--- a/src/input_stream.h
+++ b/src/input_stream.h
@@ -168,6 +168,13 @@ void
input_stream_lock_wait_ready(struct input_stream *is);
/**
+ * Determines whether seeking is cheap. This is true for local files.
+ */
+gcc_pure gcc_nonnull(1)
+bool
+input_stream_cheap_seeking(const struct input_stream *is);
+
+/**
* Seeks to the specified position in the stream. This will most
* likely fail if the "seekable" flag is false.
*