diff options
author | Chris Robinson <[email protected]> | 2011-05-13 21:27:46 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-05-13 21:27:46 -0700 |
commit | c39f27d5f89f278a09b05f3dfdc9a3f245a0f9af (patch) | |
tree | bbd87beb5c35c475427a3304bfbdc84d7b985ec0 /Alc/ALc.c | |
parent | c9ac4f06ff48343526686e7828941cc1d04ba455 (diff) |
Set the duplicate-stereo flag properly after the device format is reset
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r-- | Alc/ALc.c | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -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; |