@@ -218,7 +218,7 @@ static int get_value(AVIOContext *pb, int type, int type2_size)
static int asf_read_picture(AVFormatContext *s, int len)
{
AVPacket pkt = { 0 };
- const CodecMime *mime = ff_id3v2_mime_tags;
+ const AVCodecDescriptor *cdesc;
enum AVCodecID id = AV_CODEC_ID_NONE;
char mimetype[64];
uint8_t *desc = NULL;
@@ -245,13 +245,8 @@ static int asf_read_picture(AVFormatContext *s, int len)
/* picture MIME type */
len -= avio_get_str16le(s->pb, len, mimetype, sizeof(mimetype));
- while (mime->id != AV_CODEC_ID_NONE) {
- if (!strncmp(mime->str, mimetype, sizeof(mimetype))) {
- id = mime->id;
- break;
- }
- mime++;
- }
+ if ((cdesc = avcodec_descriptor_get_by_mime_type(mimetype, "image")))
+ id = cdesc->id;
if (id == AV_CODEC_ID_NONE) {
av_log(s, AV_LOG_ERROR, "Unknown attached picture mimetype: %s.\n",
mimetype);
@@ -359,7 +359,7 @@ static int asf_read_picture(AVFormatContext *s, int len)
{
ASFContext *asf = s->priv_data;
AVPacket pkt = { 0 };
- const CodecMime *mime = ff_id3v2_mime_tags;
+ const AVCodecDescriptor *cdesc;
enum AVCodecID id = AV_CODEC_ID_NONE;
char mimetype[64];
uint8_t *desc = NULL;
@@ -387,13 +387,8 @@ static int asf_read_picture(AVFormatContext *s, int len)
/* picture MIME type */
len -= avio_get_str16le(s->pb, len, mimetype, sizeof(mimetype));
- while (mime->id != AV_CODEC_ID_NONE) {
- if (!strncmp(mime->str, mimetype, sizeof(mimetype))) {
- id = mime->id;
- break;
- }
- mime++;
- }
+ if ((cdesc = avcodec_descriptor_get_by_mime_type(mimetype, "image")))
+ id = cdesc->id;
if (id == AV_CODEC_ID_NONE) {
av_log(s, AV_LOG_ERROR, "Unknown attached picture mimetype: %s.\n",
mimetype);