diff options
author | Max Kellermann <max@duempel.org> | 2012-02-11 16:39:03 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-02-11 16:39:03 +0100 |
commit | 8ec8282f38876b5b266e387cb9157ccd229d0afa (patch) | |
tree | a7a8c580d3e1f41592b093df3432911d5bf1955a | |
parent | 43b7b98949b5a7bee008404e0054b51f9d84ceb9 (diff) | |
download | mpd-8ec8282f38876b5b266e387cb9157ccd229d0afa.tar.gz mpd-8ec8282f38876b5b266e387cb9157ccd229d0afa.tar.xz mpd-8ec8282f38876b5b266e387cb9157ccd229d0afa.zip |
decoder/ffmpeg: use the tag_table library
Diffstat (limited to '')
-rw-r--r-- | src/decoder/ffmpeg_metadata.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/decoder/ffmpeg_metadata.c b/src/decoder/ffmpeg_metadata.c index ce943f3dd..d091afbc6 100644 --- a/src/decoder/ffmpeg_metadata.c +++ b/src/decoder/ffmpeg_metadata.c @@ -20,26 +20,22 @@ #include "config.h" #include "ffmpeg_metadata.h" #include "tag.h" +#include "tag_table.h" #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "ffmpeg" -typedef struct ffmpeg_tag_map { - enum tag_type type; - const char *name; -} ffmpeg_tag_map; - -static const ffmpeg_tag_map ffmpeg_tag_maps[] = { +static const struct tag_table ffmpeg_tags[] = { #if LIBAVFORMAT_VERSION_INT < ((52<<16)+(50<<8)) - { TAG_ARTIST, "author" }, - { TAG_DATE, "year" }, + { "author", TAG_ARTIST }, + { "year", TAG_DATE }, #endif - { TAG_ARTIST_SORT, "author-sort" }, - { TAG_ALBUM_ARTIST, "album_artist" }, - { TAG_ALBUM_ARTIST_SORT, "album_artist-sort" }, + { "author-sort", TAG_ARTIST_SORT }, + { "album_artist", TAG_ALBUM_ARTIST }, + { "album_artist-sort", TAG_ALBUM_ARTIST_SORT }, /* sentinel */ - { TAG_NUM_OF_ITEM_TYPES, NULL } + { NULL, TAG_NUM_OF_ITEM_TYPES } }; static void @@ -59,7 +55,7 @@ ffmpeg_copy_dictionary(struct tag *tag, AVDictionary *dict) ffmpeg_copy_metadata(tag, i, dict, tag_item_names[i]); - for (const struct ffmpeg_tag_map *i = ffmpeg_tag_maps; + for (const struct tag_table *i = ffmpeg_tags; i->name != NULL; ++i) ffmpeg_copy_metadata(tag, i->type, dict, i->name); } |