2008/7/15 Benjamin Larsson <[EMAIL PROTECTED]>:
> 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.

This code is actually very similar to what was there originally. I
probably shouldn't have applied the patch in the first place and
removed the realloc replacing with some logic plus av_free and
av_malloc. As I've done it, I'm going to carry on, but in future I'll
try to avoid such things.

Rob
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to