@@ -80,22 +80,17 @@ static int flac_write_picture(struct AVFormatContext *s, AVPacket *pkt)
FlacMuxerContext *c = s->priv_data;
AVIOContext *pb = s->pb;
const AVPixFmtDescriptor *pixdesc;
- const CodecMime *mime = ff_id3v2_mime_tags;
AVDictionaryEntry *e;
const char *mimetype = NULL, *desc = "";
const AVStream *st = s->streams[pkt->stream_index];
+ const AVCodecDescriptor *cdesc = avcodec_descriptor_get(st->codecpar->codec_id);
int i, mimelen, desclen, type = 0, blocklen;
if (!pkt->data)
return 0;
- while (mime->id != AV_CODEC_ID_NONE) {
- if (mime->id == st->codecpar->codec_id) {
- mimetype = mime->str;
- break;
- }
- mime++;
- }
+ if (cdesc && cdesc->mime_types)
+ mimetype = cdesc->mime_types[0];
if (!mimetype) {
av_log(s, AV_LOG_ERROR, "No mimetype is known for stream %d, cannot "
"write an attached picture.\n", st->index);