zmwangx / rust-ffmpeg

Safe FFmpeg wrapper.
Do What The F*ck You Want To Public License
1.3k stars 203 forks source link

Fix incorrect sizes for plane and data slices for audio frames. #104

Open tage64 opened 2 years ago

tage64 commented 2 years ago

This pull request fixes two bugs:

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.

sagudev commented 2 years ago

I just tested myself and can confirm that plane() is now working as intended.