@@ -585,7 +585,7 @@ static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen,
{
int enc, pic_type;
char mimetype[64] = {0};
- const CodecMime *mime = ff_id3v2_mime_tags;
+ const AVCodecDescriptor *desc;
enum AVCodecID id = AV_CODEC_ID_NONE;
ID3v2ExtraMetaAPIC *apic = NULL;
ID3v2ExtraMeta *new_extra = NULL;
@@ -614,13 +614,9 @@ static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen,
taglen -= 3;
}
- while (mime->id != AV_CODEC_ID_NONE) {
- if (!av_strncasecmp(mime->str, mimetype, sizeof(mimetype))) {
- id = mime->id;
- break;
- }
- mime++;
- }
+ if ((desc = avcodec_descriptor_get_by_mime_type(mimetype, "image")))
+ id = desc->id;
+
if (id == AV_CODEC_ID_NONE) {
av_log(s, AV_LOG_WARNING,
"Unknown attached picture mimetype: %s, skipping.\n", mimetype);