The size of a plane created by frame::Audio::plane() for a packed audio frame with more than one channel was incorrectly set to the number of samples. It is now changed to be the number of samples times the number of channels.
The size of the slice created by frame::Audio::data(n) for n > 0 was incorrectly set to 0. It is now changed to be the same as for n=0.
Some explanations can be found at the doxygen documentation for AVFrame.
In particular:
◆ linesize
int AVFrame::linesize[AV_NUM_DATA_POINTERS]
...
For audio, only linesize[0] may be set. For planar audio, each channel plane must be the same size.
This pull request fixes two bugs:
frame::Audio::plane()
for a packed audio frame with more than one channel was incorrectly set to the number of samples. It is now changed to be the number of samples times the number of channels.frame::Audio::data(n)
forn > 0
was incorrectly set to0
. It is now changed to be the same as forn=0
.Some explanations can be found at the doxygen documentation for AVFrame. In particular: