[MPlayer-dev-eng] [PATCH] bigendian fix for hwac3

Ulion ulion2002 at gmail.com
Sat Sep 15 17:33:47 CEST 2007


2007/9/15, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> Hello,
> On Sat, Sep 15, 2007 at 06:04:14PM +0800, Ulion wrote:
> >      buf16[0] = 0xF872;   // iec 61937 syncword 1
> >      buf16[1] = 0x4E1F;   // iec 61937 syncword 2
> >      buf16[2] = 0x0001;   // data-type ac3
> > +    buf16[2] |= (uint16_t)(sh_audio->a_in_buffer[5] & 0x7) << 8; // bsmod
>
> I forgot, this also misses a check for len >= 6. Even though it won't
> produce a playable frame anyway if this isn't the case, it still seems
> advisable for "cosmetic" reasons (I guess that even without this check
> it can't really crash, a_in_buffer is probably always large enough)...
>

if len is returned from ac3dts_fillbuff(), it always greater than 6.
If len is from sh_audio->a_in_buffer_len, the
sh_audio->a_in_buffer_len is assigned same with return value of
ac3dts_fillbuff() and be set to zero every time do ac3 or dts output.

So here len should be always greater than 6.

-- 
Ulion



More information about the MPlayer-dev-eng mailing list