From ac51c9cce67dcaa968f527e54c48f20d54117c76 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 31 Oct 2014 17:18:45 -0700 Subject: Add preliminary AL_EXT_BFORMAT support Currently missing the AL_ORIENTATION source property. Gain stepping also does not work. --- Alc/mixer.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Alc/mixer.c') diff --git a/Alc/mixer.c b/Alc/mixer.c index 1cc3fe9d..762fc7fe 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -185,6 +185,7 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam ResamplerFunc Resample; ALbufferlistitem *BufferListItem; ALuint DataPosInt, DataPosFrac; + ALboolean isbformat = AL_FALSE; ALboolean Looping; ALuint increment; enum Resampler Resampler; @@ -206,6 +207,18 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam NumChannels = Source->NumChannels; SampleSize = Source->SampleSize; + while(BufferListItem) + { + ALbuffer *buffer; + if((buffer=BufferListItem->buffer) != NULL) + { + isbformat = (buffer->FmtChannels == FmtBFormat2D || + buffer->FmtChannels == FmtBFormat3D); + break; + } + BufferListItem = BufferListItem->next; + } + Mix = SelectMixer(); HrtfMix = SelectHrtfMixer(); Resample = SelectResampler(Resampler, increment); @@ -428,6 +441,10 @@ ALvoid MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALuint Sam &parms->Mix.Hrtf.State[chan], DstBufferSize); } + /* Only the first channel for B-Format buffers (W channel) goes to + * the send paths. */ + if(chan > 0 && isbformat) + continue; for(j = 0;j < Device->NumAuxSends;j++) { SendParams *parms = &voice->Send[j]; -- cgit v1.2.3