From c39f27d5f89f278a09b05f3dfdc9a3f245a0f9af Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 13 May 2011 21:27:46 -0700 Subject: Set the duplicate-stereo flag properly after the device format is reset --- Alc/ALc.c | 21 +++++++++++++++------ 1 file 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; -- cgit v1.2.3