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 iOS audio driver attempting to start output too early #98305

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

cadence-s
Copy link
Contributor

@cadence-s cadence-s commented Oct 18, 2024

Fixes #87560.

The code for audio output resuming when returning from the background in OS_IOS::on_focus_in caused iOS builds to throw an error on startup, since the same function is also called on the initial launch, when not all the necessary components exist yet. This adds a null pointer check to prevent the invalid attempt. The audio output will still start once the AudioServer is initialized.

@cadence-s cadence-s requested a review from a team as a code owner October 18, 2024 17:23
@AThousandShips AThousandShips added bug platform:ios topic:audio cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Oct 19, 2024
@AThousandShips AThousandShips added this to the 4.4 milestone Oct 19, 2024
@adamscott adamscott requested a review from bruvzg October 22, 2024 23:51
Copy link
Member

@adamscott adamscott left a comment

Choose a reason for hiding this comment

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

Looks good to me. I'm approving, but I still need to test the PR.

Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

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

Tested on Mac, AudioDriverCoreAudio::start was called before init and adding this check will fix error print on start.

@clayjohn clayjohn merged commit a1c7998 into godotengine:master Oct 25, 2024
20 checks passed
@clayjohn
Copy link
Member

clayjohn commented Oct 25, 2024

Thank you! And congratulations on your first merged contribution!! 🥳

@akien-mga akien-mga removed the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release platform:ios topic:audio topic:porting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Project Exported to IOS error message in Xcode: AudioOutputUnitStart failed, code: -50
6 participants