[FFmpeg-devel] [PATCH] MLP/TrueHD decoder

Michael Niedermayer michaelni
Fri Nov 23 20:27:07 CET 2007


On Mon, Nov 19, 2007 at 10:02:19AM +0000, Ian Caulfield wrote:
> Hi
> 
> On Nov 19, 2007 1:26 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> >
> > On Sun, Nov 18, 2007 at 08:58:05PM +0000, Ian Caulfield wrote:
> > > On Nov 18, 2007 4:43 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > > >
> > > > > +
> > > > > +        ff_combine_frame(&mp->pc, i - 7, &buf, &buf_size);
> > > > > +
> > > > > +        return FFMAX(i - 7, 0);
> > > >
> > > > i think this should be return i-7
> > >
> > > Is it valid to return a negative number in a non-error case?
> >
> > the code which calls it says:
> >
> >     /* WARNING: the returned index can be negative */
> >     index = s->parser->parser_parse(s, avctx, (const uint8_t **)poutbuf, poutbuf_size, buf, buf_size);
> 
> Fair enough, updated patch attached.
[...]
> +        for (p = 0; p < 4; p++)
> +            parity_bits ^= buf[p];
> +        for (i = 0; i < mp->num_substreams; i++) {
> +            parity_bits ^= buf[p];
> +            parity_bits ^= buf[p+1];
> +
> +            if (buf[p] & 0x80) {
> +                parity_bits ^= buf[p+2];
> +                parity_bits ^= buf[p+3];
> +                p += 2;
> +            }
> +            p += 2;

for(i = -1; i < mp->num_substreams; i++) {
    parity_bits ^= buf[p++];
    parity_bits ^= buf[p++];
    if (i<0 || buf[p-2] & 0x80) {
        parity_bits ^= buf[p++];
        parity_bits ^= buf[p++];
    }
}



[...]
> +#ifdef CONFIG_AUDIO_NONSHORT
> +        avctx->bits_per_sample = mh.group1_bits;
> +        if (avctx->bits_per_sample > 16)
> +//            avctx->sample_fmt = SAMPLE_FMT_S32;
> +#endif
> +        avctx->sample_rate = mh.group1_samplerate;

this is broken if the ifdef is true

except these iam fine with the patch

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- 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/20071123/4178ec8d/attachment.pgp>



More information about the ffmpeg-devel mailing list