diff options
author | Max Kellermann <max@duempel.org> | 2012-02-11 10:34:21 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-02-11 12:37:24 +0100 |
commit | 767ade02f4af8cdb6b7de293d0bd433bc7fd24cf (patch) | |
tree | 657ef4bf4fc49524007cb6e26d214edb04585ff3 /src/decoder | |
parent | 6e05071a47cd2f496f49d08823ace6fdcb1f79cd (diff) | |
download | mpd-767ade02f4af8cdb6b7de293d0bd433bc7fd24cf.tar.gz mpd-767ade02f4af8cdb6b7de293d0bd433bc7fd24cf.tar.xz mpd-767ade02f4af8cdb6b7de293d0bd433bc7fd24cf.zip |
tag_table: convert to a struct
The struct is smaller because it is sparse. Its traversal is also
more efficient.
Diffstat (limited to 'src/decoder')
-rw-r--r-- | src/decoder/mp4ff_decoder_plugin.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/decoder/mp4ff_decoder_plugin.c b/src/decoder/mp4ff_decoder_plugin.c index 89f65670e..6202ece9e 100644 --- a/src/decoder/mp4ff_decoder_plugin.c +++ b/src/decoder/mp4ff_decoder_plugin.c @@ -356,16 +356,17 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *input_stream) mp4ff_close(mp4fh); } -static const char *const mp4ff_tag_names[TAG_NUM_OF_ITEM_TYPES] = { - [TAG_ALBUM_ARTIST] = "album artist", - [TAG_COMPOSER] = "writer", - [TAG_PERFORMER] = "band", +static const struct tag_table mp4ff_tags[] = { + { "album artist", TAG_ALBUM_ARTIST }, + { "writer", TAG_COMPOSER }, + { "band", TAG_PERFORMER }, + { NULL, TAG_NUM_OF_ITEM_TYPES } }; static enum tag_type mp4ff_tag_name_parse(const char *name) { - enum tag_type type = tag_table_lookup(mp4ff_tag_names, name); + enum tag_type type = tag_table_lookup_i(mp4ff_tags, name); if (type == TAG_NUM_OF_ITEM_TYPES) type = tag_name_parse_i(name); |