aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-10-31 17:18:45 -0700
committerChris Robinson <[email protected]>2014-10-31 17:18:45 -0700
commitac51c9cce67dcaa968f527e54c48f20d54117c76 (patch)
treee908cf48d51f8e6ce19613c6b016b0c5abc0a22d /Alc/mixer.c
parent1c0596c233525e9a582269faa4ccb017e5938a28 (diff)
Add preliminary AL_EXT_BFORMAT support
Currently missing the AL_ORIENTATION source property. Gain stepping also does not work.
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r--Alc/mixer.c17
1 files changed, 17 insertions, 0 deletions
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];