aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/ffmpeg_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/ffmpeg_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/ffmpeg_metadata.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/decoder/ffmpeg_metadata.c b/src/decoder/ffmpeg_metadata.c
index 5325c1cae..df700fc01 100644
--- a/src/decoder/ffmpeg_metadata.c
+++ b/src/decoder/ffmpeg_metadata.c
@@ -50,6 +50,21 @@ ffmpeg_copy_metadata(enum tag_type type,
type, mt->value);
}
+#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,5,0)
+
+static void
+ffmpeg_scan_pairs(AVDictionary *dict,
+ const struct tag_handler *handler, void *handler_ctx)
+{
+ AVDictionaryEntry *i = NULL;
+
+ while ((i = av_dict_get(dict, "", i, AV_DICT_IGNORE_SUFFIX)) != NULL)
+ tag_handler_invoke_pair(handler, handler_ctx,
+ i->key, i->value);
+}
+
+#endif
+
void
ffmpeg_scan_dictionary(AVDictionary *dict,
const struct tag_handler *handler, void *handler_ctx)
@@ -62,4 +77,9 @@ ffmpeg_scan_dictionary(AVDictionary *dict,
i->name != NULL; ++i)
ffmpeg_copy_metadata(i->type, dict, i->name,
handler, handler_ctx);
+
+#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,5,0)
+ if (handler->pair != NULL)
+ ffmpeg_scan_pairs(dict, handler, handler_ctx);
+#endif
}