aboutsummaryrefslogtreecommitdiffstats
path: root/src/input_stream.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-09-16 21:06:12 +0200
committerMax Kellermann <max@duempel.org>2011-09-16 21:22:02 +0200
commit29241c4f835797f635816a9f37528aa981f722b5 (patch)
treeda166b242c4d960619498b9b7bd13ec44415915d /src/input_stream.c
parent6f655eb9b90e0855112038c0779eb61194cb7ef6 (diff)
downloadmpd-29241c4f835797f635816a9f37528aa981f722b5.tar.gz
mpd-29241c4f835797f635816a9f37528aa981f722b5.tar.xz
mpd-29241c4f835797f635816a9f37528aa981f722b5.zip
input_plugin: add method check()
To check for errors without reading. The decoder thread wants to do that, before it passes the input stream to the plugin.
Diffstat (limited to 'src/input_stream.c')
-rw-r--r--src/input_stream.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/input_stream.c b/src/input_stream.c
index 44ab7159f..164df9860 100644
--- a/src/input_stream.c
+++ b/src/input_stream.c
@@ -67,6 +67,16 @@ input_stream_open(const char *url, GError **error_r)
return NULL;
}
+bool
+input_stream_check(struct input_stream *is, GError **error_r)
+{
+ assert(is != NULL);
+ assert(is->plugin != NULL);
+
+ return is->plugin->check == NULL ||
+ is->plugin->check(is, error_r);
+}
+
void
input_stream_update(struct input_stream *is)
{