]> git.sesse.net Git - ffmpeg/commitdiff
avformat/id3v2: detect PNG by header instead of mime
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 18 Jun 2015 16:37:39 +0000 (18:37 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 18 Jun 2015 16:38:53 +0000 (18:38 +0200)
the mimetype for PNG can be set to jpeg

Fixes 01\ -\ Cider\ Time.mp3

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

index 2289bfc15a7f36c66046a386ac0b2ccfb8f5ec00..52d85312e497a446bd81e10f26652c3713fe0f5c 100644 (file)
@@ -1083,6 +1083,9 @@ int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta)
         st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
         st->codec->codec_id   = apic->id;
 
+        if (AV_RB64(apic->buf->data) == 0x89504e470d0a1a0a)
+            st->codec->codec_id = AV_CODEC_ID_PNG;
+
         if (apic->description[0])
             av_dict_set(&st->metadata, "title", apic->description, 0);