Skip to content

Commit

Permalink
Modified OSX11 to try alternative audio drivers if pulseaudio does no…
Browse files Browse the repository at this point in the history
…t work or user dislikes lennart potering , fixes godotengine#1511
  • Loading branch information
reduz committed Apr 12, 2015
1 parent ab6eaa3 commit 87c51b6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion platform/x11/os_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,20 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi

if (AudioDriverManagerSW::get_driver(p_audio_driver)->init()!=OK) {

ERR_PRINT("Initializing audio failed.");
bool success=false;
for(int i=0;i<AudioDriverManagerSW::get_driver_count();i++) {
if (i==p_audio_driver)
continue;
if (AudioDriverManagerSW::get_driver(i)->init()==OK) {
success=true;
print_line("Using alternate audio driver: "+String(AudioDriverManagerSW::get_driver(i)->get_name()));
break;
}
}
if (!success) {
ERR_PRINT("Initializing audio failed.");
}

}

sample_manager = memnew( SampleManagerMallocSW );
Expand Down

0 comments on commit 87c51b6

Please sign in to comment.