[FFmpeg-devel] [PATCH 12/15] lavf/mp3enc: use codec descs for query_codec
rcombs
rcombs at rcombs.me
Wed Sep 9 09:02:14 EEST 2020
---
libavformat/mp3enc.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index a3586e1f86..eb8cc2e22f 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -489,12 +489,9 @@ static int mp3_write_trailer(struct AVFormatContext *s)
static int query_codec(enum AVCodecID id, int std_compliance)
{
- const CodecMime *cm= ff_id3v2_mime_tags;
- while(cm->id != AV_CODEC_ID_NONE) {
- if(id == cm->id)
- return MKTAG('A', 'P', 'I', 'C');
- cm++;
- }
+ const AVCodecDescriptor *desc = avcodec_descriptor_get(id);
+ if (desc && desc->type == AVMEDIA_TYPE_VIDEO && desc->mime_types)
+ return MKTAG('A', 'P', 'I', 'C');
return -1;
}
--
2.27.0
More information about the ffmpeg-devel
mailing list