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 issue where audio context is closed twice on FF #412

Merged
merged 1 commit into from
Aug 4, 2021

Conversation

glharper
Copy link
Member

@glharper glharper commented Aug 4, 2021

Either the FF JS engine is now super fast, or the audioContext close takes longer to return than for Chromium. This fixes a race condition in MicAudioSource where:

  • await this.privContext.close() is called, takes a while to return, so in the meantime
  • stream.detach() is called, which calls this.turnOff(), which calls this.destroyAudioContext, which calls this.privContext.close() again

@glharper glharper requested a review from rhurey August 4, 2021 18:30
Copy link
Contributor

@BrianMouncer BrianMouncer left a comment

Choose a reason for hiding this comment

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

This looks good to me, so long as privIsClosing is thread safe.

@glharper glharper merged commit 567c72e into master Aug 4, 2021
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