[FFmpeg-devel] Audio decoding in api-example.c broken?

Michael Niedermayer michaelni
Mon May 24 00:51:20 CEST 2010


On Sun, May 23, 2010 at 08:45:51PM +0300, Martin Storsj? wrote:
> Hi,
> 
> libavcodec/api-example.c seems to be broken regarding audio decoding, 
> since SVN rev 9144, 27th May 2007. api-example.c reads a fixed buffer 
> size from the file, and then decodes a number of frames from the read 
> buffer, but the last frame is incomplete (since the input buffer size 
> isn't aligned with the compressed frame size). This gives a decode error 
> for the last audio frame, which is incomplete, exiting the whole test 
> application.
> 
> Before rev 9144, the mp2 decoder consumed the whole input buffer at once, 
> so the approach in api-example.c worked fine.
> 
> Michael, any suggestion on how this should be handled? Should the audio 
> frames be written to file with some kind of simplistic framing/container 
> format? Or does the mp2 decoder handle being fed with incomplete frames, 
> and we should just adjust the error handling in api-example?

a AVParser could be used or you could implement some buffer that is refilled
after each frame is decoded

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100524/2e278647/attachment.pgp>



More information about the ffmpeg-devel mailing list