Fix audio clips streaming to be thread-safe when audio sources play

#786
This commit is contained in:
Wojtek Figat
2022-10-29 18:57:57 +02:00
parent 6379171fa6
commit 57e812d336
4 changed files with 10 additions and 5 deletions

View File

@@ -139,10 +139,12 @@ namespace ALC
alSourcef(sourceID, AL_GAIN, source->GetVolume());
alSourcef(sourceID, AL_PITCH, source->GetPitch());
alSourcef(sourceID, AL_SEC_OFFSET, 0.0f);
alSourcef(sourceID, AL_REFERENCE_DISTANCE, source->GetMinDistance());
alSourcef(sourceID, AL_ROLLOFF_FACTOR, source->GetAttenuation());
alSourcei(sourceID, AL_LOOPING, loop);
alSourcei(sourceID, AL_SOURCE_RELATIVE, !is3D);
alSourcei(sourceID, AL_BUFFER, 0);
alSource3f(sourceID, AL_POSITION, FLAX_POS_TO_OAL(position));
alSource3f(sourceID, AL_VELOCITY, FLAX_POS_TO_OAL(velocity));
}