diff options
author | Chris Robinson <[email protected]> | 2017-02-28 23:18:51 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-02-28 23:18:51 -0800 |
commit | d1833c7b94fef1b6af73c1f33dd2441d80d95852 (patch) | |
tree | 84b9e3360942d896bf1e0817d67f98fd66a5731d /Alc/ALc.c | |
parent | 521abf2e0725cc4e4abfc17e75681e47fb372f68 (diff) |
Increment MixCount in UpdateClockBase
This is to protect clocktime reads since the backend lock won't protect it.
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r-- | Alc/ALc.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1780,12 +1780,15 @@ static void alcSetError(ALCdevice *device, ALCenum errorCode) * * Updates the device's base clock time with however many samples have been * done. This is used so frequency changes on the device don't cause the time - * to jump forward or back. + * to jump forward or back. Must not be called while the device is running/ + * mixing. */ static inline void UpdateClockBase(ALCdevice *device) { + IncrementRef(&device->MixCount); device->ClockBase += device->SamplesDone * DEVICE_CLOCK_RES / device->Frequency; device->SamplesDone = 0; + IncrementRef(&device->MixCount); } /* UpdateDeviceParams |