aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/oss.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-01-09 06:40:50 -0800
committerChris Robinson <[email protected]>2010-01-09 06:40:50 -0800
commitef7df2416debb882c42124bddc07808c00a4503b (patch)
tree20e2e8a67a0a3bb8d8175994b4f006c6fcc456cd /Alc/oss.c
parentcb113315f7cacfef0ca1f7a08d714344a89447da (diff)
Hide OSS and Solaris devices if their files can't be stat'd
Diffstat (limited to 'Alc/oss.c')
-rw-r--r--Alc/oss.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/Alc/oss.c b/Alc/oss.c
index d0dbff80..ec45093a 100644
--- a/Alc/oss.c
+++ b/Alc/oss.c
@@ -169,7 +169,8 @@ static ALCboolean oss_open_playback(ALCdevice *device, const ALCchar *deviceName
if(data->fd == -1)
{
free(data);
- AL_PRINT("Could not open %s: %s\n", driver, strerror(errno));
+ if(errno != ENOENT)
+ AL_PRINT("Could not open %s: %s\n", driver, strerror(errno));
return ALC_FALSE;
}
@@ -336,7 +337,8 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName)
if(data->fd == -1)
{
free(data);
- AL_PRINT("Could not open %s: %s\n", driver, strerror(errno));
+ if(errno != ENOENT)
+ AL_PRINT("Could not open %s: %s\n", driver, strerror(errno));
return ALC_FALSE;
}
@@ -492,9 +494,27 @@ void alc_oss_deinit(void)
void alc_oss_probe(int type)
{
if(type == DEVICE_PROBE)
- AppendDeviceList(oss_device);
+ {
+#ifdef HAVE_STAT
+ struct stat buf;
+ if(stat(GetConfigValue("oss", "device", "/dev/dsp"), &buf) == 0)
+#endif
+ AppendDeviceList(oss_device);
+ }
else if(type == ALL_DEVICE_PROBE)
- AppendAllDeviceList(oss_device);
+ {
+#ifdef HAVE_STAT
+ struct stat buf;
+ if(stat(GetConfigValue("oss", "device", "/dev/dsp"), &buf) == 0)
+#endif
+ AppendAllDeviceList(oss_device);
+ }
else if(type == CAPTURE_DEVICE_PROBE)
- AppendCaptureDeviceList(oss_device_capture);
+ {
+#ifdef HAVE_STAT
+ struct stat buf;
+ if(stat(GetConfigValue("oss", "capture", "/dev/dsp"), &buf) == 0)
+#endif
+ AppendCaptureDeviceList(oss_device_capture);
+ }
}