aboutsummaryrefslogtreecommitdiffstats
path: root/src/input_stream.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-03 23:29:45 +0100
committerMax Kellermann <max@duempel.org>2009-01-03 23:29:45 +0100
commit700bd44fdaaa0b3ebc6924180daae8f5105d0cd8 (patch)
tree88455844f452f7b49fac139d39a823e7e5b8ffa0 /src/input_stream.c
parent4be479d20c2f81fb0303106b7080af93b3c456c6 (diff)
downloadmpd-700bd44fdaaa0b3ebc6924180daae8f5105d0cd8.tar.gz
mpd-700bd44fdaaa0b3ebc6924180daae8f5105d0cd8.tar.xz
mpd-700bd44fdaaa0b3ebc6924180daae8f5105d0cd8.zip
input_stream: added tag() method
The tag() method reads a tag from the stream. This replaces the meta_name and meta_title attributes.
Diffstat (limited to 'src/input_stream.c')
-rw-r--r--src/input_stream.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/input_stream.c b/src/input_stream.c
index 3df8fe006..f69debbf9 100644
--- a/src/input_stream.c
+++ b/src/input_stream.c
@@ -68,8 +68,6 @@ input_stream_open(struct input_stream *is, const char *url)
is->size = -1;
is->error = 0;
is->mime = NULL;
- is->meta_name = NULL;
- is->meta_title = NULL;
for (unsigned i = 0; i < num_input_plugins; ++i) {
const struct input_plugin *plugin = input_plugins[i];
@@ -89,6 +87,16 @@ input_stream_seek(struct input_stream *is, off_t offset, int whence)
return is->plugin->seek(is, offset, whence);
}
+struct tag *
+input_stream_tag(struct input_stream *is)
+{
+ assert(is != NULL);
+
+ return is->plugin->tag != NULL
+ ? is->plugin->tag(is)
+ : NULL;
+}
+
size_t
input_stream_read(struct input_stream *is, void *ptr, size_t size)
{
@@ -103,8 +111,6 @@ void input_stream_close(struct input_stream *is)
is->plugin->close(is);
g_free(is->mime);
- g_free(is->meta_name);
- g_free(is->meta_title);
}
bool input_stream_eof(struct input_stream *is)