From 29241c4f835797f635816a9f37528aa981f722b5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 16 Sep 2011 21:06:12 +0200 Subject: 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. --- src/input_stream.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/input_stream.c') 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) { -- cgit v1.2.3