Search
lxdream.org :: lxdream/src/aica/audio.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/aica/audio.c
changeset 779:a60e47313e7b
prev759:f16975739abc
next934:3acd3b3ee6d1
author nkeynes
date Mon Jul 28 10:10:13 2008 +0000 (11 years ago)
permissions -rw-r--r--
last change If the requested audio driver won't initialize, try all the others in order (worst case, null driver)
file annotate diff log raw
1.1 --- a/src/aica/audio.c Mon Jul 21 01:01:39 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 }
.