aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-03 09:07:31 +0100
committerMax Kellermann <max@duempel.org>2012-02-03 09:10:48 +0100
commit378fa5ee6af1d127d4fa363de4af5294778e89cc (patch)
tree874ba96d0c34f6aca144a0be57740baac72e1c14 /src
parent4764daf3c29d22c2b21473612c1acfc55b1c4775 (diff)
downloadmpd-378fa5ee6af1d127d4fa363de4af5294778e89cc.tar.gz
mpd-378fa5ee6af1d127d4fa363de4af5294778e89cc.tar.xz
mpd-378fa5ee6af1d127d4fa363de4af5294778e89cc.zip
decoder/ffmpeg: support all MPD tags
Use the tag_item_names table to look up the names of all MPD tags, and remove the duplicate entries from ffmpeg_tag_maps.
Diffstat (limited to '')
-rw-r--r--src/decoder/ffmpeg_decoder_plugin.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c
index 0340e9506..2616d95c7 100644
--- a/src/decoder/ffmpeg_decoder_plugin.c
+++ b/src/decoder/ffmpeg_decoder_plugin.c
@@ -587,24 +587,13 @@ typedef struct ffmpeg_tag_map {
} ffmpeg_tag_map;
static const ffmpeg_tag_map ffmpeg_tag_maps[] = {
- { TAG_TITLE, "title" },
-#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(50<<8))
- { TAG_ARTIST, "artist" },
- { TAG_DATE, "date" },
-#else
+#if LIBAVFORMAT_VERSION_INT < ((52<<16)+(50<<8))
{ TAG_ARTIST, "author" },
{ TAG_DATE, "year" },
#endif
- { TAG_ALBUM, "album" },
- { TAG_COMMENT, "comment" },
- { TAG_GENRE, "genre" },
- { TAG_TRACK, "track" },
{ TAG_ARTIST_SORT, "author-sort" },
{ TAG_ALBUM_ARTIST, "album_artist" },
{ TAG_ALBUM_ARTIST_SORT, "album_artist-sort" },
- { TAG_COMPOSER, "composer" },
- { TAG_PERFORMER, "performer" },
- { TAG_DISC, "disc" },
};
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53,1,0)
@@ -626,6 +615,10 @@ ffmpeg_copy_metadata(struct tag *tag, enum tag_type type,
static void
ffmpeg_copy_dictionary(struct tag *tag, AVDictionary *dict)
{
+ for (unsigned i = 0; i < TAG_NUM_OF_ITEM_TYPES; ++i)
+ ffmpeg_copy_metadata(tag, i,
+ dict, tag_item_names[i]);
+
for (unsigned i = 0; i < G_N_ELEMENTS(ffmpeg_tag_maps); i++)
ffmpeg_copy_metadata(tag, ffmpeg_tag_maps[i].type,
dict, ffmpeg_tag_maps[i].name);