mp3/mp2: identify the video codecs as APIC through query_codec.
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 4 Aug 2012 17:00:44 +0000 (19:00 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 10 Aug 2012 15:24:39 +0000 (17:24 +0200)
Fixes Ticket1408

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mp3enc.c

index 0ce1ddc..a515fb1 100644 (file)
@@ -370,6 +370,17 @@ static int mp2_write_trailer(struct AVFormatContext *s)
     return 0;
 }
 
+static int query_codec(enum CodecID id, int std_compliance)
+{
+    CodecMime *cm= ff_id3v2_mime_tags;
+    while(cm->id != CODEC_ID_NONE) {
+        if(id == cm->id)
+            return MKTAG('A', 'P', 'I', 'C');
+        cm++;
+    }
+    return -1;
+}
+
 #if CONFIG_MP2_MUXER
 AVOutputFormat ff_mp2_muxer = {
     .name              = "mp2",
@@ -516,6 +527,7 @@ AVOutputFormat ff_mp3_muxer = {
     .write_header      = mp3_write_header,
     .write_packet      = mp3_write_packet,
     .write_trailer     = mp3_write_trailer,
+    .query_codec       = query_codec,
     .flags             = AVFMT_NOTIMESTAMPS,
     .priv_class        = &mp3_muxer_class,
 };