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

Mixer v2 + fix for memory leak #138

Merged
merged 6 commits into from
Sep 15, 2024
Merged

Mixer v2 + fix for memory leak #138

merged 6 commits into from
Sep 15, 2024

Conversation

MarkKremer
Copy link
Contributor

@MarkKremer MarkKremer commented Jan 3, 2024

  • Add an option to Mixer to let it drain when all its streamers have been drained instead of playing silence. I have added this in preparation of an optimization that I would like to do in the speaker to auto-close Oto's player when nothing is being played anymore. edit: may not be relevant anymore.
  • Updated the Streamer interface. Now it allows Streamers to use the samples passed to Steam() as scratch space even if it doesn't fill it completely. Mixer previously didn't adhere to the interface when it said it wasn't allowed to do that. I think programs can be more efficient when Streamers are allowed to do that. This is also how the Reader interface works. Reverted this change to keep backwards compatibility. I may introduce this change again when we move to v3.
  • Use Mixer to replace the implementation for Mix(). Mix() should work the same as before.
  • Fix memory leak where drained streamers weren't being garbage collected.

Edit:
Resolves #179

@MarkKremer MarkKremer changed the title Mixer v2 Mixer v2 & fix for memory leak Sep 11, 2024
@MarkKremer MarkKremer changed the title Mixer v2 & fix for memory leak Mixer v2 + fix for memory leak Sep 11, 2024
@MarkKremer MarkKremer marked this pull request as ready for review September 11, 2024 14:27
@MarkKremer MarkKremer merged commit 0e22572 into main Sep 15, 2024
1 check passed
@MarkKremer MarkKremer deleted the mixer-v2 branch September 15, 2024 19:20
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.

speaker.Play() seems to introduce a memory leak.
2 participants