[Ffmpeg-devel] silent audio at the end of a song?

Ronald S. Bultje rbultje
Thu Jan 4 05:49:03 CET 2007


Hi,

I noticed that the last frame of my mp3s, when decoded using ffmpeg's
mp3 decoder, always contains a bunch (several hundreds) of zero-bytes.
The mp3 decoder (which I'm using as a testcase here) indeed doesn't
appear to handle "partial frames" (assuming any such a thing exists in
the mp3 specs in the first place (?)), since mp_decode_layer3() just
returns nb_granules*18 as the mount of data decoded, with nb being
either 1 or 2, and then mp_decode_frame() returns that number *32, which
is 576 or 1152 (i.e. the max. size of a mp3 frame).

I don't mind diving into this, but since I'm not very good at mp3 (or
any audio format for that matter), is anyone good at this and willing to
do it instead? I noticed the /* XXX: should compute exact size */ in
mp_decode_layer3(), I'm assuming it refers to this, but the relation
between scale factors, exponents (calculated from scale factors??) and
the final audio samples still isn't 100% clear to me, so I wouldn't know
what needs to be done to know how many audio samples should remain
"empty".

Any pointers appreciated. :-).

Thanks,
Ronald





More information about the ffmpeg-devel mailing list