[MPlayer-cvslog] CVS: main/libmpdemux demux_audio.c,1.32,1.33

Moritz Bunkus moritz at bunkus.org
Mon Apr 18 16:25:56 CEST 2005


Hey,

> An acceptable alternative would be brute force scanning, but only
> considering header _chains_ in deciding what type the file is
> (sequences of headers each pointing to the next one, or at least to a
> point before the next one).

Agree. My experience with AC3 and MP3 detection in ogmtools/mkvtoolnix
was that

- garbage is only present at the start of the file (e.g. extracted from
  AVIs created with NanDub or other f'cked up software)

- once you find n (e.g. five) consecutive headers you can be pretty sure
  that it's a raw MP3/AC3 file. Consecutive means that the next packet
  starts exactly at first_pos + first_length

- if you find garbage in the middle then you probably have another file:
  MPEG PS/SS, AVI etc. File type detection for such files has to be done
  before audio file type detection because both the MP3 and the AC3
  headers are not unique enough in their patterns. "RIFF" at file
  position 0 ( = AVI) is.

- never underestimate the problem with ID3 tags. Those may appear at the
  start of the file. And very, very few files even contain a complete
  image in them...

- probing 3000 bytes is definitely not enough. Neither for AC3 nor for
  MP3.

Mosu

-- 
If Darl McBride was in charge, he'd probably make marriage
unconstitutional too, since clearly it de-emphasizes the commercial
nature of normal human interaction, and probably is a major impediment
to the commercial growth of prostitution. - Linus Torvalds

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-cvslog/attachments/20050418/086a7679/attachment.pgp>


More information about the MPlayer-cvslog mailing list