Commit 001e2a60 authored by Max Kellermann's avatar Max Kellermann

decoder/ffmpeg: add macros emulating AVDictionary

Move the #ifdefs out of _copy_metadata().
parent f370911c
...@@ -607,26 +607,20 @@ static const ffmpeg_tag_map ffmpeg_tag_maps[] = { ...@@ -607,26 +607,20 @@ static const ffmpeg_tag_map ffmpeg_tag_maps[] = {
{ TAG_DISC, "disc" }, { TAG_DISC, "disc" },
}; };
static void #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53,1,0)
ffmpeg_copy_metadata(struct tag *tag, #define AVDictionary AVMetadata
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53,1,0) #define AVDictionaryEntry AVMetadataTag
AVDictionary *m, #define av_dict_get av_metadata_get
#else
AVMetadata *m,
#endif #endif
static void
ffmpeg_copy_metadata(struct tag *tag, AVDictionary *m,
const ffmpeg_tag_map tag_map) const ffmpeg_tag_map tag_map)
{ {
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,5,0)
AVDictionaryEntry *mt = NULL; AVDictionaryEntry *mt = NULL;
while ((mt = av_dict_get(m, tag_map.name, mt, 0)) != NULL) while ((mt = av_dict_get(m, tag_map.name, mt, 0)) != NULL)
tag_add_item(tag, tag_map.type, mt->value); 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 #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment