Search
lxdream.org :: lxdream :: r779:a60e47313e7b
lxdream 0.9.1
released Jun 29
Download Now
changeset779:a60e47313e7b
parent778:a34b180d92f7
child780:4e4ea322cb84
authornkeynes
dateMon Jul 28 10:10:13 2008 +0000 (11 years ago)
If the requested audio driver won't initialize, try all the others in order (worst case, null driver)
src/aica/audio.c
1.1 --- a/src/aica/audio.c Mon Jul 28 06:39:00 2008 +0000
1.2 +++ b/src/aica/audio.c Mon Jul 28 10:10:13 2008 +0000
1.3 @@ -116,10 +116,17 @@
1.4 ERROR( "Audio driver '%s' not found, aborting.", preferred_driver );
1.5 exit(2);
1.6 } else if( audio_set_driver( audio_driver ) == FALSE ) {
1.7 - ERROR( "Failed to initialize audio driver '%s', using null driver",
1.8 - audio_driver->name );
1.9 - audio_driver = &audio_null_driver;
1.10 - audio_set_driver( &audio_null_driver );
1.11 + int i;
1.12 + for( i=0; audio_driver_list[i] != NULL; i++ ) {
1.13 + if( audio_driver_list[i] != audio_driver &&
1.14 + audio_set_driver( audio_driver_list[i] ) ) {
1.15 + ERROR( "Failed to initialize audio driver %s, falling back to %s",
1.16 + audio_driver->name, audio_driver_list[i]->name );
1.17 + return audio_driver_list[i];
1.18 + }
1.19 + }
1.20 + ERROR( "Unable to intialize any audio driver, aborting." );
1.21 + exit(2);
1.22 }
1.23 return audio_driver;
1.24 }
.