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

Added software::resampling::Context::get_out_samples to bind swr_get_out_samples #88

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

Conversation

liquidev
Copy link

@liquidev liquidev commented Jan 8, 2022

When resampling, to make sure no samples are buffered internally, it's important to have a buffer large enough to fit all these samples. Up to this point there was no way of knowing how many samples should be allocated up front, so this PR adds a binding to that from libswresample.

Unresolved questions:

  • swr_get_out_samples accepts an int, but I'm sure it expects the input sample count to be positive. It's probably an oversight on libswresample's part, so I kind of fixed it, and made the method return an error if the argument passed does not fit in an i32. It feels quite janky though so I need an opinion from the maintainers.

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.

1 participant