aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-05-13 21:27:46 -0700
committerChris Robinson <[email protected]>2011-05-13 21:27:46 -0700
commitc39f27d5f89f278a09b05f3dfdc9a3f245a0f9af (patch)
treebbd87beb5c35c475427a3304bfbdc84d7b985ec0
parentc9ac4f06ff48343526686e7828941cc1d04ba455 (diff)
Set the duplicate-stereo flag properly after the device format is reset
-rw-r--r--Alc/ALc.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index b9e54e13..2a678c7c 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1183,6 +1183,21 @@ static ALCboolean UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
device->Bs2b = NULL;
}
+ device->Flags &= ~DEVICE_DUPLICATE_STEREO;
+ switch(device->FmtChans)
+ {
+ case DevFmtMono:
+ case DevFmtStereo:
+ break;
+ case DevFmtQuad:
+ case DevFmtX51:
+ case DevFmtX61:
+ case DevFmtX71:
+ if(GetConfigValueBool(NULL, "stereodup", AL_TRUE))
+ device->Flags |= DEVICE_DUPLICATE_STEREO;
+ break;
+ }
+
for(i = 0;i < device->NumContexts;i++)
{
ALCcontext *context = device->Contexts[i];
@@ -2346,9 +2361,6 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
device->Bs2bLevel = GetConfigValueInt(NULL, "cf_level", 0);
- if(GetConfigValueBool(NULL, "stereodup", AL_TRUE))
- device->Flags |= DEVICE_DUPLICATE_STEREO;
-
// Find a playback device to open
SuspendContext(NULL);
for(i = 0;BackendList[i].Init;i++)
@@ -2521,9 +2533,6 @@ ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(void)
device->Bs2bLevel = GetConfigValueInt(NULL, "cf_level", 0);
- if(GetConfigValueBool(NULL, "stereodup", AL_TRUE))
- device->Flags |= DEVICE_DUPLICATE_STEREO;
-
// Open the "backend"
SuspendContext(NULL);
device->Funcs = &BackendLoopback.Funcs;