From ffea273a28179d2b5bbc24f967517bcf80940c63 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 11 Feb 2012 19:24:51 +0100 Subject: 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. --- test/read_tags.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/read_tags.c b/test/read_tags.c index 9fcf1acfe..b5ca8e55a 100644 --- a/test/read_tags.c +++ b/test/read_tags.c @@ -145,13 +145,20 @@ print_duration(unsigned seconds, G_GNUC_UNUSED void *ctx) static void print_tag(enum tag_type type, const char *value, G_GNUC_UNUSED void *ctx) { - g_print("%s=%s\n", tag_item_names[type], value); + g_print("[%s]=%s\n", tag_item_names[type], value); empty = false; } +static void +print_pair(const char *name, const char *value, G_GNUC_UNUSED void *ctx) +{ + g_print("\"%s\"=%s\n", name, value); +} + static const struct tag_handler print_handler = { .duration = print_duration, .tag = print_tag, + .pair = print_pair, }; int main(int argc, char **argv) -- cgit v1.2.3