diff src/audio/nto/SDL_nto_audio.c @ 2938:2929ed239d2a

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).
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 01 Jan 2009 07:54:58 +0000
parents 99210400e8b9
children 1e431c2631ee
line wrap: on
line diff
--- a/src/audio/nto/SDL_nto_audio.c	Wed Dec 31 08:05:21 2008 +0000
+++ b/src/audio/nto/SDL_nto_audio.c	Thu Jan 01 07:54:58 2009 +0000
@@ -434,6 +434,7 @@
 static int
 NTO_Init(SDL_AudioDriverImpl * impl)
 {
+    /* !!! FIXME: not right for device enum? */
     /*  See if we can open a nonblocking channel. */
     snd_pcm_t *handle = NULL;
     int rval = snd_pcm_open_preferred(&handle, NULL, NULL, OPEN_FLAGS);
@@ -455,7 +456,8 @@
     impl->CloseDevice = NTO_CloseDevice;
     impl->OnlyHasDefaultOutputDevice = 1;       /* !!! FIXME: add device enum! */
 
-    return 1;
+    /* !!! FIXME: device enum might make this 1. */
+    return 2;  /* 2 == definitely has an audio device. */
 }
 
 AudioBootStrap QNXNTOAUDIO_bootstrap = {