whatwg / mimesniff

MIME Sniffing Standard
https://mimesniff.spec.whatwg.org/
Other
105 stars 44 forks source link

Matching pattern for aac (and aac with ID3) in adts stream #114

Open corneldamian opened 4 years ago

corneldamian commented 4 years ago

There is no way in "Matching an audio or video type pattern" to detect aac (in adts streams), only in m4a (mp4) containers. There should be a way to detect the adts streams and more, to detect adts stream when they have a id3 metadata at the beginning. Right now all the audio files starting with id3 are considered mp3, which it's wrong. Apple it's using id3 even on some mp4 files. I think, when id3 it's detected, the checker should skip until the end of id3 container and then start detection for aac and mp3 like it will try to match mp3 without id3.

Thanks

annevk commented 4 years ago

Are browsers exhibiting this behavior somehow?

GPHemsley commented 2 years ago

Firefox is: https://hg.mozilla.org/mozilla-central/file/tip/dom/media/ADTSDemuxer.cpp