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

Allocate/deallocate native input/output buffers on init/release #202

Merged
merged 2 commits into from
Jul 11, 2022

Conversation

izzytwosheds
Copy link
Contributor

@izzytwosheds izzytwosheds commented Jul 3, 2022

We were allocating native buffers for Oboe audio processor on each frame and not de-allocating them, as was pointed out in #201
Instead, now we are allocating them when we initialize the resampler (when we know the buffer size) and deallocating them when we release the resampler.

Comment on lines 101 to 105
delete resamplerInputBuffer;
resamplerInputBuffer = nullptr;
}
if (resamplerOutputBuffer != nullptr) {
delete resamplerOutputBuffer;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should these be delete[] (e.g. delete[] resamplerInputBuffer) instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. It should. Changed.

@izzytwosheds izzytwosheds merged commit 9677d4a into linkedin:main Jul 11, 2022
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