On Wed, Sep 4, 2013 at 6:06 PM, Justin Ruggles <[email protected]>wrote:

> AVFrame.linesize[0] for audio is the size of the buffer for one plane. It
> does not necessarily mean that the whole buffer contains real audio
> samples. For example, it could be padded to a multiple of some specific
> size for SIMD processing, or the decoder could buffer more samples than are
> needed because it needs the buffer before it knows exactly how many samples
> will end up in the frame.
>

Yes I have caught with similar issue while migrating to planar audio
formats in my application.
Technically application is not interested in AVFrame.linesize[0] at all.
Application is interesting in size of actually decoded samples (aPlaneSize
in example), not in allocated buffer size:
> int aPlaneSize = 0;
> int aDataSize = av_samples_get_buffer_size (&aPlaneSize,
myCodecCtx->channels,
>
myFrame.Frame->nb_samples,
>
myCodecCtx->sample_fmt, 1);

-----------------------------------------------
Kirill Gavrilov,
Software designer.
<[email protected]>
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to