aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/flac_metadata.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-11 19:24:51 +0100
committerMax Kellermann <max@duempel.org>2012-02-12 13:41:48 +0100
commitffea273a28179d2b5bbc24f967517bcf80940c63 (patch)
tree5891ed63a60ba0eed7c2b4433ea72f566f982822 /src/decoder/flac_metadata.c
parent1783aac4384ccc53d9ad25c237d4286ccdbccbc0 (diff)
downloadmpd-ffea273a28179d2b5bbc24f967517bcf80940c63.tar.gz
mpd-ffea273a28179d2b5bbc24f967517bcf80940c63.tar.xz
mpd-ffea273a28179d2b5bbc24f967517bcf80940c63.zip
tag_handler: handle arbitrary name/value pairs
The new method pair() receives an arbitrary name/value pair. Support for this is being added to a few decoder plugins.
Diffstat (limited to '')
-rw-r--r--src/decoder/flac_metadata.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/decoder/flac_metadata.c b/src/decoder/flac_metadata.c
index 9e138ef96..bd1eaf323 100644
--- a/src/decoder/flac_metadata.c
+++ b/src/decoder/flac_metadata.c
@@ -196,6 +196,19 @@ flac_scan_comment(const char *char_tnum,
const FLAC__StreamMetadata_VorbisComment_Entry *entry,
const struct tag_handler *handler, void *handler_ctx)
{
+ if (handler->pair != NULL) {
+ char *name = g_strdup((const char*)entry->entry);
+ char *value = strchr(name, '=');
+
+ if (value != NULL && value > name) {
+ *value++ = 0;
+ tag_handler_invoke_pair(handler, handler_ctx,
+ name, value);
+ }
+
+ g_free(name);
+ }
+
for (const struct tag_table *i = flac_tags; i->name != NULL; ++i)
if (flac_copy_comment(entry, i->name, i->type, char_tnum,
handler, handler_ctx))