aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSource.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-11-23 01:31:13 -0800
committerChris Robinson <[email protected]>2016-11-23 01:31:13 -0800
commit6886f77cbc02b93db3682acb27eb767c6541fba0 (patch)
tree3c081ac0e3327054214f66706cb8c55739ee3679 /OpenAL32/alSource.c
parentfcb669f803d37be80492879801fba9c9011f7edf (diff)
Only send source updates for sources that have updated
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r--OpenAL32/alSource.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index b65c2c18..9ef58115 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -399,6 +399,8 @@ static ALint Int64ValsByProp(ALenum prop)
#define DO_UPDATEPROPS() do { \
if(SourceShouldUpdate(Source, Context)) \
UpdateSourceProps(Source, device->NumAuxSends); \
+ else \
+ Source->NeedsUpdate = AL_TRUE; \
} while(0)
static ALboolean SetSourcefv(ALsource *Source, ALCcontext *Context, SourceProp prop, const ALfloat *values)
@@ -2772,6 +2774,8 @@ static void InitSourceParams(ALsource *Source)
ATOMIC_INIT(&Source->looping, AL_FALSE);
+ Source->NeedsUpdate = AL_TRUE;
+
ATOMIC_INIT(&Source->Update, NULL);
ATOMIC_INIT(&Source->FreeList, NULL);
}
@@ -2924,8 +2928,12 @@ void UpdateAllSourceProps(ALCcontext *context)
ALvoice *voice = &context->Voices[pos];
ALsource *source = voice->Source;
if(source != NULL && (source->state == AL_PLAYING ||
- source->state == AL_PAUSED))
+ source->state == AL_PAUSED) &&
+ source->NeedsUpdate)
+ {
+ source->NeedsUpdate = AL_FALSE;
UpdateSourceProps(source, num_sends);
+ }
}
}
@@ -3029,6 +3037,7 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
}
}
+ Source->NeedsUpdate = AL_FALSE;
UpdateSourceProps(Source, device->NumAuxSends);
}
else if(state == AL_PAUSED)