diff options
Diffstat (limited to 'alc/alc.cpp')
-rw-r--r-- | alc/alc.cpp | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index b63f0f82..bbcd6d01 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -1430,15 +1430,6 @@ ALCenum EnumFromDevAmbi(DevAmbiScaling scaling) * existing ones. Based on Wine's DSound downmix values, which are based on * PulseAudio's. */ -const std::array<InputRemixMap,7> MonoDownmix{{ - { FrontLeft, {{{FrontCenter, 0.5f}, {LFE, 0.0f}}} }, - { FrontRight, {{{FrontCenter, 0.5f}, {LFE, 0.0f}}} }, - { SideLeft, {{{FrontCenter, 0.5f/9.0f}, {LFE, 0.0f}}} }, - { SideRight, {{{FrontCenter, 0.5f/9.0f}, {LFE, 0.0f}}} }, - { BackLeft, {{{FrontCenter, 0.5f/9.0f}, {LFE, 0.0f}}} }, - { BackRight, {{{FrontCenter, 0.5f/9.0f}, {LFE, 0.0f}}} }, - { BackCenter, {{{FrontCenter, 1.0f/9.0f}, {LFE, 0.0f}}} }, -}}; const std::array<InputRemixMap,6> StereoDownmix{{ { FrontCenter, {{{FrontLeft, 0.5f}, {FrontRight, 0.5f}}} }, { SideLeft, {{{FrontLeft, 1.0f/9.0f}, {FrontRight, 0.0f}}} }, @@ -1855,17 +1846,6 @@ ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList) DevFmtChannelsString(device->FmtChans), DevFmtTypeString(device->FmtType), device->Frequency, device->UpdateSize, device->BufferSize); - switch(device->FmtChans) - { - case DevFmtMono: device->RealOut.RemixMap = MonoDownmix; break; - case DevFmtStereo: device->RealOut.RemixMap = StereoDownmix; break; - case DevFmtQuad: device->RealOut.RemixMap = QuadDownmix; break; - case DevFmtX51: device->RealOut.RemixMap = X51Downmix; break; - case DevFmtX61: device->RealOut.RemixMap = X61Downmix; break; - case DevFmtX71: device->RealOut.RemixMap = X71Downmix; break; - case DevFmtAmbi3D: break; - } - if(device->Type != DeviceType::Loopback) { if(auto modeopt = device->configValue<std::string>(nullptr, "stereo-mode")) @@ -1899,6 +1879,20 @@ ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList) device->SourcesMax, device->NumMonoSources, device->NumStereoSources, device->AuxiliaryEffectSlotMax, device->NumAuxSends); + switch(device->FmtChans) + { + case DevFmtMono: break; + case DevFmtStereo: + if(!device->mUhjEncoder) + device->RealOut.RemixMap = StereoDownmix; + break; + case DevFmtQuad: device->RealOut.RemixMap = QuadDownmix; break; + case DevFmtX51: device->RealOut.RemixMap = X51Downmix; break; + case DevFmtX61: device->RealOut.RemixMap = X61Downmix; break; + case DevFmtX71: device->RealOut.RemixMap = X71Downmix; break; + case DevFmtAmbi3D: break; + } + nanoseconds::rep sample_delay{0}; if(device->mUhjEncoder) sample_delay += UhjEncoder::sFilterDelay; |