On 17 Oct 2014, at 08:32, Martin Storsjö <[email protected]> wrote:

>> - if a downmix is requested, the 6-channel buffer allocated during init gets 
>> used
>> 
>> - if no downmix is requested, the 6-channel buffer allocated during init is 
>> freed and a buffer large enough only for the actual output size is used, 
>> but, that would also be a 6-channel buffer, so what's the point of not using 
>> the initial buffer?
> 
> It's not "a buffer large enough only for the actual output size", it's "the 
> output AVFrame" that is allocated once we know the exact number of channels, 
> vs a generic buffer allocated with av_malloc. The point in not using the 
> initial buffer is that we'd rather decode straight into the AVFrame if 
> possible, to avoid an extra memcpy.

That's much clearer, thanks.

> I'm not sure if it's kosher to request e.g. a 6 channel AVFrame and then just 
> flip it to 2 channels after allocation - if it is, then we could of course 
> simplify that, but that is unrelated to this patch, this is what we do 
> already.

Either way, the commit message should be reworked, IMO.

Tim
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to