[FFmpeg-soc] [soc]: r2788 - aac/aac.c

Benjamin Larsson banan at ludd.ltu.se
Tue Jul 15 15:26:26 CEST 2008


superdump wrote:
> Author: superdump
> Date: Tue Jul 15 15:24:22 2008
> New Revision: 2788
>
> Log:
> Dynamically allocate an aligned buffer for interleaved_output rather than
> having a mostly redundant large array in the context
>
> [...]
>  
> +    // allocate appropriately aligned buffer for interleaved output
> +    if(!ac->interleaved_output)
> +        ac->interleaved_output = av_malloc(channels * 1024 * sizeof(float));
> +    else if(channels != avctx->channels) {
> +        av_free(ac->interleaved_output);
> +        ac->interleaved_output = av_malloc(channels * 1024 * sizeof(float));
> +    }
> +
>   

You should only reallocate when there are more channels then before.

MvH
Benjamin Larsson





More information about the FFmpeg-soc mailing list