在ffmpeg,音频数据会保存在AVFrame中extended_data数组中,如果是打包模式(packed),就只用extended_data[0];如果是planar模式,则每个channel分别保存在extended_data[i]中。对于音频,只有linesize[0]有效,打包模式保存整个音频帧的buff大小,planar模式保存每个channel的buff大小。
ffmpeg中对两种模式(planar和packed)的说明(在samplefmt.h中有详细说明):
* For planar sample formats, each audio channel is in a separate data plane,
* and linesize is the buffer size, in bytes, for a single plane. All data
* planes must be the same size. For packed sample formats, only the first data
* plane is used, and samples for each channel are interleaved. In t