aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-03 09:18:05 +0100
committerMax Kellermann <max@duempel.org>2012-02-03 09:18:05 +0100
commit083340a9373537faacf67cc2ba8bc82238e104c4 (patch)
tree9b58a55d26526c6dbe4b8d7d8f38b728ddffab5d /src
parent378fa5ee6af1d127d4fa363de4af5294778e89cc (diff)
downloadmpd-083340a9373537faacf67cc2ba8bc82238e104c4.tar.gz
mpd-083340a9373537faacf67cc2ba8bc82238e104c4.tar.xz
mpd-083340a9373537faacf67cc2ba8bc82238e104c4.zip
decoder/ffmpeg: use sentinel for the ffmpeg_tag_maps table
Minor optimisation.
Diffstat (limited to '')
-rw-r--r--src/decoder/ffmpeg_decoder_plugin.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c
index 2616d95c7..b3c3744a1 100644
--- a/src/decoder/ffmpeg_decoder_plugin.c
+++ b/src/decoder/ffmpeg_decoder_plugin.c
@@ -594,6 +594,9 @@ static const ffmpeg_tag_map ffmpeg_tag_maps[] = {
{ TAG_ARTIST_SORT, "author-sort" },
{ TAG_ALBUM_ARTIST, "album_artist" },
{ TAG_ALBUM_ARTIST_SORT, "album_artist-sort" },
+
+ /* sentinel */
+ { TAG_NUM_OF_ITEM_TYPES, NULL }
};
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53,1,0)
@@ -619,9 +622,9 @@ ffmpeg_copy_dictionary(struct tag *tag, AVDictionary *dict)
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);
+ for (const struct ffmpeg_tag_map *i = ffmpeg_tag_maps;
+ i->name != NULL; ++i)
+ ffmpeg_copy_metadata(tag, i->type, dict, i->name);
}
#endif