Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tage64
Copy link

@tage64 tage64 commented Jun 14, 2022

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) 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.

@sagudev
Copy link

sagudev commented Aug 10, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants