[FFmpeg-devel] [PATCH] Remove noise message from MP3 decoder

Chris Rankin rankincj at yahoo.com
Wed Sep 7 02:34:44 CEST 2011


Hi,

I was testing xine recently with an old movie trailer when I noticed that my 
console log was getting spammed with these messages:

[mp3 @ 0xad218660] incorrect frame size
[mp3 @ 0xad218660] incorrect frame size
[mp3 @ 0xad218660] incorrect frame size
[mp3 @ 0xad218660] incorrect frame size
[mp3 @ 0xad218660] incorrect frame size
[mp3 @ 0xad218660] incorrect frame size

Digging further, I discovered that the MP3 decoder in libavcodec will always 
print this message whenever it is handed a packet with more than one frame in. 
There are a number of problems with this:

a) This isn't an error. The audio stream plays fine.
b) AV_LOG_ERROR is supposed to be reserved for "Something went wrong and cannot 
losslessly be recovered". However, the situation *is* "recovered" from without loss.
c) avcodec_decode_audio3() is documented as accepting an AVPacket. But if an 
AVPacket can legitimately contain multiple frames then why is the MP3 decoder 
complaining about it in the first place?

I've attached two alternative patches for this: one (my preferred solution) just 
removes the error message entirely. The second demotes the message to DEBUG 
level instead, just in case someone might actually want to see it. (I can't 
imagine why, though.)

In either case, the semantics of the libavcodec() API are unaffected. There is 
just a slight reduction in console spam.

Cheers,
Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MPEGAUDIODEC-silent.diff
Type: text/x-patch
Size: 401 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110907/8eba3d84/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MPEGAUDIODEC-debug.diff
Type: text/x-patch
Size: 494 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110907/8eba3d84/attachment-0001.bin>


More information about the ffmpeg-devel mailing list