aboutsummaryrefslogtreecommitdiffstats
path: root/test/read_tags.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-12-30 23:27:37 +0100
committerMax Kellermann <max@duempel.org>2010-01-01 17:25:07 +0100
commitd3b763a48c09a60a0c0b5ccb6cccd9376875c470 (patch)
tree83b8794f78ef8941806cf5757888d8abf2eaa126 /test/read_tags.c
parent816b6ad4a71c3ade95e62b62396f2b0415c03f20 (diff)
downloadmpd-d3b763a48c09a60a0c0b5ccb6cccd9376875c470.tar.gz
mpd-d3b763a48c09a60a0c0b5ccb6cccd9376875c470.tar.xz
mpd-d3b763a48c09a60a0c0b5ccb6cccd9376875c470.zip
input_stream: return allocated input_stream objects
Major API redesign: don't let the caller allocate the input_stream object. Let each input plugin allocate its own (derived/extended) input_stream pointer. The "data" attribute can now be removed, and all input plugins simply cast the input_stream pointer to their own structure (with an "struct input_stream base" as the first attribute).
Diffstat (limited to 'test/read_tags.c')
-rw-r--r--test/read_tags.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/read_tags.c b/test/read_tags.c
index a16b703f0..8138c187f 100644
--- a/test/read_tags.c
+++ b/test/read_tags.c
@@ -170,17 +170,17 @@ int main(int argc, char **argv)
tag = decoder_plugin_tag_dup(plugin, path);
if (tag == NULL && plugin->stream_tag != NULL) {
- struct input_stream is;
+ struct input_stream *is = input_stream_open(path, &error);
- if (!input_stream_open(&is, path, &error)) {
+ if (is == NULL) {
g_printerr("Failed to open %s: %s\n",
path, error->message);
g_error_free(error);
return 1;
}
- tag = decoder_plugin_stream_tag(plugin, &is);
- input_stream_close(&is);
+ tag = decoder_plugin_stream_tag(plugin, is);
+ input_stream_close(is);
}
decoder_plugin_deinit_all();