Adjusted default choice of audio driver.

If a driver can definitely see available devices, it is chosen. Otherwise,
 we'll take the first driver that initializes but saw no devices...this might
 be because it can't enumerate them, or there really aren't any available.

This prevents the dsp driver from hogging control when there are no /dev/dsp*
 nodes (for example, on a Linux box with ALSA and no OSS emulation).

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403400
This commit is contained in:
Ryan C. Gordon 2009-01-01 07:54:58 +00:00
parent 6611747b8f
commit 0e24b20c3b
20 changed files with 44 additions and 17 deletions

View file

@ -444,7 +444,7 @@ BSDAUDIO_Init(SDL_AudioDriverImpl * impl)
impl->Deinitialize = BSDAUDIO_Deinitialize;
build_device_lists();
return 1;
return (outputDeviceCount > 0) ? 2 : 1;
}