aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-03 09:02:14 +0100
committerMax Kellermann <max@duempel.org>2012-02-03 09:02:14 +0100
commit001e2a604b396d613671132300972b41567e0262 (patch)
tree8f86fbfe2ce0269f29c07492f90b0b8b8cbdc0f9 /src/decoder
parentf370911c15476c4d69895b6de76dca942dd99c2c (diff)
downloadmpd-001e2a604b396d613671132300972b41567e0262.tar.gz
mpd-001e2a604b396d613671132300972b41567e0262.tar.xz
mpd-001e2a604b396d613671132300972b41567e0262.zip
decoder/ffmpeg: add macros emulating AVDictionary
Move the #ifdefs out of _copy_metadata().
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/ffmpeg_decoder_plugin.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c
index 29bf804f1..5d7f33bd7 100644
--- a/src/decoder/ffmpeg_decoder_plugin.c
+++ b/src/decoder/ffmpeg_decoder_plugin.c
@@ -607,26 +607,20 @@ static const ffmpeg_tag_map ffmpeg_tag_maps[] = {
{ TAG_DISC, "disc" },
};
-static void
-ffmpeg_copy_metadata(struct tag *tag,
-#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53,1,0)
- AVDictionary *m,
-#else
- AVMetadata *m,
+#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53,1,0)
+#define AVDictionary AVMetadata
+#define AVDictionaryEntry AVMetadataTag
+#define av_dict_get av_metadata_get
#endif
+
+static void
+ffmpeg_copy_metadata(struct tag *tag, AVDictionary *m,
const ffmpeg_tag_map tag_map)
{
-#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,5,0)
AVDictionaryEntry *mt = NULL;
while ((mt = av_dict_get(m, tag_map.name, mt, 0)) != NULL)
tag_add_item(tag, tag_map.type, mt->value);
-#else
- AVMetadataTag *mt = NULL;
-
- while ((mt = av_metadata_get(m, tag_map.name, mt, 0)) != NULL)
- tag_add_item(tag, tag_map.type, mt->value);
-#endif
}
#endif