aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-03 09:08:06 +0100
committerMax Kellermann <max@duempel.org>2012-02-03 09:09:18 +0100
commit4764daf3c29d22c2b21473612c1acfc55b1c4775 (patch)
treef89626af517998db7163a1a26f1499374a69b532 /src
parent6357496d17a4fbcf8280ba721b5235567137eafc (diff)
downloadmpd-4764daf3c29d22c2b21473612c1acfc55b1c4775.tar.gz
mpd-4764daf3c29d22c2b21473612c1acfc55b1c4775.tar.xz
mpd-4764daf3c29d22c2b21473612c1acfc55b1c4775.zip
decoder/ffmpeg: pass tag_type and name to _copy_metadata()
Allow using this function without the ffmpeg_tag_map struct.
Diffstat (limited to 'src')
-rw-r--r--src/decoder/ffmpeg_decoder_plugin.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c
index 947241599..0340e9506 100644
--- a/src/decoder/ffmpeg_decoder_plugin.c
+++ b/src/decoder/ffmpeg_decoder_plugin.c
@@ -614,20 +614,21 @@ static const ffmpeg_tag_map ffmpeg_tag_maps[] = {
#endif
static void
-ffmpeg_copy_metadata(struct tag *tag, AVDictionary *m,
- const ffmpeg_tag_map tag_map)
+ffmpeg_copy_metadata(struct tag *tag, enum tag_type type,
+ AVDictionary *m, const char *name)
{
AVDictionaryEntry *mt = NULL;
- while ((mt = av_dict_get(m, tag_map.name, mt, 0)) != NULL)
- tag_add_item(tag, tag_map.type, mt->value);
+ while ((mt = av_dict_get(m, name, mt, 0)) != NULL)
+ tag_add_item(tag, type, mt->value);
}
static void
ffmpeg_copy_dictionary(struct tag *tag, AVDictionary *dict)
{
for (unsigned i = 0; i < G_N_ELEMENTS(ffmpeg_tag_maps); i++)
- ffmpeg_copy_metadata(tag, dict, ffmpeg_tag_maps[i]);
+ ffmpeg_copy_metadata(tag, ffmpeg_tag_maps[i].type,
+ dict, ffmpeg_tag_maps[i].name);
}
#endif