diff options
author | Chris Robinson <[email protected]> | 2014-09-03 16:29:17 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-09-03 16:29:17 -0700 |
commit | 2f2768e7c3a7e0dd5d926ea1eafb7313a58a07d9 (patch) | |
tree | eddd9846a1d55838d6c566b03f9bb542c2f1c69e /Alc/midi | |
parent | 30e01a7dba78826ab4b0099a313c6f8a46656e42 (diff) |
Make the fontsound's buffer and link fields atomic
Diffstat (limited to 'Alc/midi')
-rw-r--r-- | Alc/midi/fluidsynth.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Alc/midi/fluidsynth.c b/Alc/midi/fluidsynth.c index 82159127..bf774ab1 100644 --- a/Alc/midi/fluidsynth.c +++ b/Alc/midi/fluidsynth.c @@ -247,6 +247,8 @@ typedef struct FSample { static void FSample_Construct(FSample *self, ALfontsound *sound) { fluid_sample_t *sample = STATIC_CAST(fluid_sample_t, self); + ALbuffer *buffer = ATOMIC_LOAD(&sound->Buffer); + memset(sample->name, 0, sizeof(sample->name)); sample->start = sound->Start; sample->end = sound->End; @@ -256,8 +258,8 @@ static void FSample_Construct(FSample *self, ALfontsound *sound) sample->origpitch = sound->PitchKey; sample->pitchadj = sound->PitchCorrection; sample->sampletype = getSampleType(sound->SampleType); - sample->valid = !!sound->Buffer; - sample->data = sound->Buffer ? sound->Buffer->data : NULL; + sample->valid = !!buffer; + sample->data = buffer ? buffer->data : NULL; sample->amplitude_that_reaches_noise_floor_is_valid = 0; sample->amplitude_that_reaches_noise_floor = 0.0; |