rust-ffmpeg
rust-ffmpeg copied to clipboard
Fix incorrect sizes for plane and data slices for audio frames.
This pull request fixes two bugs:
- 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)forn > 0was 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:
◆ 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.
I just tested myself and can confirm that plane() is now working as intended.