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

Fall back to using the NULL audio backend if the default backends don't provide any devices. #2966

Merged
merged 1 commit into from May 14, 2024

Conversation

binary1248
Copy link
Member

Title.

Because audio context creation will succeed even if the selected context cannot provide any devices, the NULL backend is never selected even on systems on which we know no audio device exists. We have to check for the existence of devices ourselves after creating a normal context and force miniaudio to create a NULL context if we determine a normal context would not provide us with any devices.

Should help with testing on audio device-less systems such as when running CI.

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 8886478280

Details

  • 0 of 42 (0.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.1%) to 51.46%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/SFML/Audio/AudioDevice.cpp 0 21 0.0%
src/SFML/Audio/SoundRecorder.cpp 0 21 0.0%
Files with Coverage Reduction New Missed Lines %
include/SFML/Audio/SoundRecorder.hpp 1 0.0%
Totals Coverage Status
Change from base Build 8884078579: -0.1%
Covered Lines: 10437
Relevant Lines: 19137

💛 - Coveralls

@ChrisThrasher
Copy link
Member

ChrisThrasher commented Apr 29, 2024

https://github.com/ChrisThrasher/SFML/actions/runs/8886742515

I rebased my tests onto this PR and we're still getting Linux and Windows CI failures. It did fix the macOS issues though.

@eXpl0it3r eXpl0it3r added this to the 3.0 milestone Apr 30, 2024
@eXpl0it3r
Copy link
Member

Seems to work fine
image

@eXpl0it3r eXpl0it3r merged commit 3345796 into master May 14, 2024
209 checks passed
@eXpl0it3r eXpl0it3r deleted the feature/null_audio branch May 14, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants