diff options
author | Chris Robinson <[email protected]> | 2016-07-30 09:29:21 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-07-30 09:29:21 -0700 |
commit | 33a84f17ac78ac1f77b48fbd1193fafab5ca14e7 (patch) | |
tree | 66055c0a89d22552b856038434333b2ca2eb06cc /Alc/ALc.c | |
parent | b5b3ea95f899410a5392fb633ace74c10bbd9921 (diff) |
Add a stand-alone upsampler for higher-order ambisonic oputput
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r-- | Alc/ALc.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2040,7 +2040,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) size += (ChannelsFromDevFmt(device->FmtChans)+4) * sizeof(device->Dry.Buffer[0]); else if(device->Hrtf || device->Uhj_Encoder || device->AmbiDecoder) size += ChannelsFromDevFmt(device->FmtChans) * sizeof(device->Dry.Buffer[0]); - else if(device->FmtChans == DevFmtAmbi2 || device->FmtChans == DevFmtAmbi3) + else if(device->FmtChans > DevFmtAmbi1 && device->FmtChans <= DevFmtAmbi3) size += 4 * sizeof(device->Dry.Buffer[0]); device->Dry.Buffer = al_calloc(16, size); if(!device->Dry.Buffer) @@ -2061,7 +2061,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) } if((device->AmbiDecoder && bformatdec_getOrder(device->AmbiDecoder) >= 2) || - device->FmtChans == DevFmtAmbi2 || device->FmtChans == DevFmtAmbi3) + (device->FmtChans > DevFmtAmbi1 && device->FmtChans <= DevFmtAmbi3)) { /* Higher-order rendering requires upsampling first-order content, so * make sure to mix it separately. @@ -2211,6 +2211,9 @@ static ALCvoid FreeDevice(ALCdevice *device) bformatdec_free(device->AmbiDecoder); device->AmbiDecoder = NULL; + ambiup_free(device->AmbiUp); + device->AmbiUp = NULL; + AL_STRING_DEINIT(device->DeviceName); al_free(device->Dry.Buffer); |