aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-05-31 00:02:57 +0200
committerMax Kellermann <max@duempel.org>2010-05-31 00:02:57 +0200
commit8af52fa205f486c8fb00910d11afbc0b82fbeaa8 (patch)
treee97d76f186ea57d574b74b1991047125730e47f3
parent3b0bf856c4db84da75c7a20ef263754c21d0c03e (diff)
downloadmpd-8af52fa205f486c8fb00910d11afbc0b82fbeaa8.tar.gz
mpd-8af52fa205f486c8fb00910d11afbc0b82fbeaa8.tar.xz
mpd-8af52fa205f486c8fb00910d11afbc0b82fbeaa8.zip
decoder/vorbis: implement method stream_tag()
This allows tags in archive files.
-rw-r--r--src/decoder/vorbis_decoder_plugin.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/decoder/vorbis_decoder_plugin.c b/src/decoder/vorbis_decoder_plugin.c
index af39aa9ad..6cbce85be 100644
--- a/src/decoder/vorbis_decoder_plugin.c
+++ b/src/decoder/vorbis_decoder_plugin.c
@@ -371,21 +371,14 @@ vorbis_stream_decode(struct decoder *decoder,
}
static struct tag *
-vorbis_tag_dup(const char *file)
+vorbis_stream_tag(struct input_stream *is)
{
struct tag *ret;
- FILE *fp;
+ struct vorbis_input_stream vis;
OggVorbis_File vf;
- fp = fopen(file, "rb");
- if (!fp) {
+ if (!vorbis_is_open(&vis, &vf, NULL, is))
return NULL;
- }
-
- if (ov_open(fp, &vf, NULL, 0) < 0) {
- fclose(fp);
- return NULL;
- }
ret = vorbis_comments_to_tag(ov_comment(&vf, -1)->user_comments);
@@ -417,7 +410,7 @@ static const char *const vorbis_mime_types[] = {
const struct decoder_plugin vorbis_decoder_plugin = {
.name = "vorbis",
.stream_decode = vorbis_stream_decode,
- .tag_dup = vorbis_tag_dup,
+ .stream_tag = vorbis_stream_tag,
.suffixes = vorbis_suffixes,
.mime_types = vorbis_mime_types
};