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

apu.c: Kill audio subsystem if there are no playback devices #1623

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions hw/xbox/mcpx/apu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2631,6 +2631,16 @@ void mcpx_apu_init(PCIBus *bus, int devfn, MemoryRegion *ram)
exit(1);
}

if (SDL_GetNumAudioDevices(0) == 0) {
SDL_QuitSubSystem(SDL_INIT_AUDIO);

if (SDL_AudioInit("dummy") < 0) {
fprintf(stderr, "Failed to initalize 'dummy' audio device\n");
assert(!"SDL_AudioInit failed!");
exit(1);
}
}

SDL_AudioDeviceID sdl_audio_dev;
sdl_audio_dev = SDL_OpenAudioDevice(NULL, 0, &sdl_audio_spec, NULL, 0);
if (sdl_audio_dev == 0) {
Expand Down
Loading