Modified OSX11 to try alternative audio drivers if pulseaudio does not work or user dislikes lennart potering , fixes #1511

This commit is contained in:
Juan Linietsky 2015-04-12 16:11:26 -03:00
parent ab6eaa3de4
commit 87c51b6fc0
1 changed files with 14 additions and 1 deletions

View File

@ -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 );