avformat/mp3enc: Improve query_codec

Signal that anything except MP3 and the ID3V2 attached pic types
are forbidden.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
release/7.0
Andreas Rheinhardt 8 months ago
parent d11b5e6096
commit eb3ee7f141
  1. 6
      libavformat/mp3enc.c

@ -495,12 +495,16 @@ static int mp3_write_trailer(struct AVFormatContext *s)
static int query_codec(enum AVCodecID id, int std_compliance) static int query_codec(enum AVCodecID id, int std_compliance)
{ {
const CodecMime *cm= ff_id3v2_mime_tags; const CodecMime *cm= ff_id3v2_mime_tags;
if (id == AV_CODEC_ID_MP3)
return 1;
while(cm->id != AV_CODEC_ID_NONE) { while(cm->id != AV_CODEC_ID_NONE) {
if(id == cm->id) if(id == cm->id)
return MKTAG('A', 'P', 'I', 'C'); return MKTAG('A', 'P', 'I', 'C');
cm++; cm++;
} }
return -1; return 0;
} }
static const AVOption options[] = { static const AVOption options[] = {

Loading…
Cancel
Save