[FFmpeg-devel] Behaviour of liba52 decoder

Michael Niedermayer michaelni
Thu Jan 10 12:27:59 CET 2008


On Thu, Jan 10, 2008 at 12:07:04PM +0100, Thorsten Jordan wrote:
> Hello,
> when feeding complete AC3 frames to the liba52-decoder-implementation
> one has to call avcodec_decode_audio2 always two times, because the
> first call fills the input buffer and then returns, whereas the second
> call decodes. This is because the loop does
>     while (buf_size > 0) {
> and buf_size is 0 after copying the data to the input buffer.
> this is in general not a problem for ffmpeg.c, as it retries, but at
> least imho a not so lucky concept for ffmpeg users just calling
> avcodec_decode_audio2. Why not giving one frame when we can give one 1:1?
> any comments?

a52_decode_frame() looks buggy yes ...
i suggest you rewrite it ...

it should roughly look like

read header
for(all 6 block)
    decode block


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- 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/20080110/22a4ccd4/attachment.pgp>

More information about the ffmpeg-devel mailing list