[FFmpeg-devel] [PATCH 5/5] ADTS to AudioSpecificConfig bitstream filter

Michael Niedermayer michaelni
Sun May 31 01:32:04 CEST 2009


On Fri, May 29, 2009 at 04:12:08PM -0400, Alex Converse wrote:
> On Wed, May 27, 2009 at 4:30 AM, Benoit Fouet <benoit.fouet at free.fr> wrote:
> > On 2009-05-26 22:38, Alex Converse wrote:
> [...]
> >
> >> +static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
> >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?AVCodecContext *avctx, const char *args,
> >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?uint8_t ?**poutbuf, int *poutbuf_size,
> >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?const uint8_t *buf, int ? ? ?buf_size,
> >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?int keyframe)
> >> +{
> >>
> >> [...]
> >>
> >> + ? ?if (avctx->extradata)
> >> + ? ? ? ?if (!show_bits(&gb, 12) == 0xfff)
> >> + ? ? ? ? ? ?return 0;
> >>
> >
> 
> good catch
> 
> [...]
> 
[...]
> +    if (!ctx->first_frame_done) {
> +        int            pce_size = 0;
> +        uint8_t        pce_data[MAX_PCE_SIZE];
> +        if (!hdr.chan_config) {
> +            init_get_bits(&gb, buf, buf_size);
> +            if (get_bits(&gb, 3) != 5) {
> +                ff_log_missing_feature(avctx, "PCE based channel configuration, where the PCE is not the first syntax element is", 0);
> +                return -1;
> +            }
> +            init_put_bits(&pb, pce_data, MAX_PCE_SIZE);
> +            pce_size = ff_copy_pce_data(&pb, &gb)/8;
> +            flush_put_bits(&pb);

> +            avctx->extradata_size = 2 + pce_size;
> +            buf_size -= get_bits_count(&gb)/8;
> +            buf      += get_bits_count(&gb)/8;
> +        } else {
> +            avctx->extradata_size = 2;
> +        }

avctx->extradata_size = 2 + pce_size;
is correct for either side of the branch

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

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali
-------------- 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/20090531/2dd3062d/attachment.pgp>



More information about the ffmpeg-devel mailing list