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.
This commit is contained in:
Max Kellermann
2012-02-11 19:24:51 +01:00
parent 1783aac438
commit ffea273a28
9 changed files with 114 additions and 9 deletions

View File

@@ -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)