aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALu.c2
-rw-r--r--Alc/mixer.c4
-rw-r--r--OpenAL32/Include/alu.h10
-rw-r--r--OpenAL32/alSource.c1
4 files changed, 9 insertions, 8 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 909c689a..d190a1be 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1693,7 +1693,7 @@ void aluMixData(ALCdevice *device, ALvoid *OutBuffer, ALsizei NumSamples)
if(source && ATOMIC_LOAD(&voice->Playing, almemory_order_relaxed) &&
voice->Step > 0)
{
- if(!MixSource(voice, source, device, SamplesToDo))
+ if(!MixSource(voice, device, SamplesToDo))
{
ATOMIC_STORE(&voice->Source, NULL, almemory_order_relaxed);
ATOMIC_STORE(&voice->Playing, false, almemory_order_release);
diff --git a/Alc/mixer.c b/Alc/mixer.c
index a63bd909..8f946f6d 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -276,7 +276,7 @@ static const ALfloat *DoFilters(ALfilterState *lpfilter, ALfilterState *hpfilter
#define RESAMPLED_BUF 1
#define FILTERED_BUF 2
#define NFC_DATA_BUF 3
-ALboolean MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei SamplesToDo)
+ALboolean MixSource(ALvoice *voice, ALCdevice *Device, ALsizei SamplesToDo)
{
ALbufferlistitem *BufferListItem;
ALbufferlistitem *BufferLoopItem;
@@ -297,7 +297,7 @@ ALboolean MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei
/* Get source info */
isplaying = true; /* Will only be called while playing. */
- isstatic = Source->SourceType == AL_STATIC;
+ isstatic = !!(voice->Flags&VOICE_IS_STATIC);
DataPosInt = ATOMIC_LOAD(&voice->position, almemory_order_acquire);
DataPosFrac = ATOMIC_LOAD(&voice->position_fraction, almemory_order_relaxed);
BufferListItem = ATOMIC_LOAD(&voice->current_buffer, almemory_order_relaxed);
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index f6462cd4..21390806 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -236,10 +236,10 @@ struct ALvoiceProps {
} Send[];
};
-/* If not 'fading', gain targets are used directly without fading. */
-#define VOICE_IS_FADING (1<<0)
-#define VOICE_HAS_HRTF (1<<1)
-#define VOICE_HAS_NFC (1<<2)
+#define VOICE_IS_STATIC (1<<0)
+#define VOICE_IS_FADING (1<<1) /* Fading sources use gain stepping for smooth transitions. */
+#define VOICE_HAS_HRTF (1<<2)
+#define VOICE_HAS_NFC (1<<3)
typedef struct ALvoice {
struct ALvoiceProps *Props;
@@ -516,7 +516,7 @@ inline void ComputeFirstOrderGains(const BFMixParams *foa, const ALfloat mtx[4],
}
-ALboolean MixSource(struct ALvoice *voice, struct ALsource *Source, ALCdevice *Device, ALsizei SamplesToDo);
+ALboolean MixSource(struct ALvoice *voice, ALCdevice *Device, ALsizei SamplesToDo);
void aluMixData(ALCdevice *device, ALvoid *OutBuffer, ALsizei NumSamples);
/* Caller must lock the device. */
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index f4d82c68..83233b3f 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -2623,6 +2623,7 @@ AL_API ALvoid AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources)
voice->Step = 0;
voice->Flags = start_fading ? VOICE_IS_FADING : 0;
+ if(source->SourceType == AL_STATIC) voice->Flags |= VOICE_IS_STATIC;
memset(voice->Direct.Params, 0, sizeof(voice->Direct.Params[0])*voice->NumChannels);
for(s = 0;s < device->NumAuxSends;s++)
memset(voice->Send[s].Params, 0, sizeof(voice->Send[s].Params[0])*voice->NumChannels);