From 33a84f17ac78ac1f77b48fbd1193fafab5ca14e7 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 30 Jul 2016 09:29:21 -0700 Subject: Add a stand-alone upsampler for higher-order ambisonic oputput --- Alc/ALc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Alc/ALc.c') diff --git a/Alc/ALc.c b/Alc/ALc.c index 13f881dd..8c6381ad 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -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); -- cgit v1.2.3