aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/oss.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2007-12-26 23:29:32 -0800
committerChris Robinson <[email protected]>2007-12-26 23:29:32 -0800
commit8011ad97b558fae4fb3c5fc44912dd7e99eed4e5 (patch)
tree1fe70d140dc06cf95d9f09118c7875431d07b3ee /Alc/oss.c
parentab8d342df06fdfcc1b630e318e121bcfb6a1cdfa (diff)
Don't check explicitly against formats, but rather their byte/channel count
Diffstat (limited to 'Alc/oss.c')
-rw-r--r--Alc/oss.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/Alc/oss.c b/Alc/oss.c
index de8f6e43..a63acb9b 100644
--- a/Alc/oss.c
+++ b/Alc/oss.c
@@ -174,17 +174,13 @@ static ALCboolean oss_open_playback(ALCdevice *device, const ALCchar *deviceName
return ALC_FALSE;
}
- switch(device->Format)
+ switch(aluBytesFromFormat(device->Format))
{
- case AL_FORMAT_MONO8:
- case AL_FORMAT_STEREO8:
- case AL_FORMAT_QUAD8:
+ case 1:
data->silence = 0x80;
ossFormat = AFMT_U8;
break;
- case AL_FORMAT_MONO16:
- case AL_FORMAT_STEREO16:
- case AL_FORMAT_QUAD16:
+ case 2:
data->silence = 0;
ossFormat = AFMT_S16_NE;
break;
@@ -337,17 +333,13 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName,
return ALC_FALSE;
}
- switch(format)
+ switch(aluBytesFromFormat(format))
{
- case AL_FORMAT_MONO8:
- case AL_FORMAT_STEREO8:
- case AL_FORMAT_QUAD8:
+ case 1:
data->silence = 0x80;
ossFormat = AFMT_U8;
break;
- case AL_FORMAT_MONO16:
- case AL_FORMAT_STEREO16:
- case AL_FORMAT_QUAD16:
+ case 2:
data->silence = 0;
ossFormat = AFMT_S16_NE;
break;