aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/dsound.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-06-04 18:33:02 -0700
committerChris Robinson <[email protected]>2008-06-04 18:33:02 -0700
commit15783d25e73276da7422bf60c27eb51d3ee9904c (patch)
tree790f6dda7b6898fa3319f6cca4c2a089ae01b983 /Alc/dsound.c
parent3243f69f217eb24f05631030858b15eaf1a0c4d6 (diff)
Don't override the format config option in DSound
Diffstat (limited to 'Alc/dsound.c')
-rw-r--r--Alc/dsound.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/Alc/dsound.c b/Alc/dsound.c
index 6b5f70d6..1bde7cb1 100644
--- a/Alc/dsound.c
+++ b/Alc/dsound.c
@@ -172,7 +172,25 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam
hr = IDirectSound_SetCooperativeLevel(pData->lpDS, GetForegroundWindow(), DSSCL_PRIORITY);
if(SUCCEEDED(hr))
- hr = IDirectSound_GetSpeakerConfig(pData->lpDS, &speakers);
+ {
+ if(*(GetConfigValue(NULL, "format", "")) != 0)
+ hr = IDirectSound_GetSpeakerConfig(pData->lpDS, &speakers);
+ else
+ {
+ if(device->Format == AL_FORMAT_MONO8 || device->Format == AL_FORMAT_MONO16)
+ speakers = DSSPEAKER_COMBINED(DSSPEAKER_MONO, 0);
+ else if(device->Format == AL_FORMAT_STEREO8 || device->Format == AL_FORMAT_STEREO16)
+ speakers = DSSPEAKER_COMBINED(DSSPEAKER_STEREO, 0);
+ else if(device->Format == AL_FORMAT_QUAD8 || device->Format == AL_FORMAT_QUAD16)
+ speakers = DSSPEAKER_COMBINED(DSSPEAKER_QUAD, 0);
+ else if(device->Format == AL_FORMAT_51CHN8 || device->Format == AL_FORMAT_51CHN16)
+ speakers = DSSPEAKER_COMBINED(DSSPEAKER_5POINT1, 0);
+ else if(device->Format == AL_FORMAT_71CHN8 || device->Format == AL_FORMAT_71CHN16)
+ speakers = DSSPEAKER_COMBINED(DSSPEAKER_7POINT1, 0);
+ else
+ hr = IDirectSound_GetSpeakerConfig(pData->lpDS, &speakers);
+ }
+ }
if(SUCCEEDED(hr))
{
speakers = DSSPEAKER_CONFIG(speakers);