aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/dsound.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-02-18 17:32:07 -0800
committerChris Robinson <[email protected]>2017-02-18 17:32:07 -0800
commit247f56249ade334f8f7ef9eda9c380af0278562f (patch)
tree9c342e82e26e39bc7b075b62ca33ddd97969015f /Alc/backends/dsound.c
parent2448f88e70f6207ad5743f0a55eaa5de7cbce737 (diff)
Always lock the device backend before calling aluMixData
Diffstat (limited to 'Alc/backends/dsound.c')
-rw-r--r--Alc/backends/dsound.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Alc/backends/dsound.c b/Alc/backends/dsound.c
index bb38d516..084d1125 100644
--- a/Alc/backends/dsound.c
+++ b/Alc/backends/dsound.c
@@ -299,8 +299,10 @@ FORCE_ALIGN static int ALCdsoundPlayback_mixerProc(void *ptr)
if(SUCCEEDED(err))
{
// If we have an active context, mix data directly into output buffer otherwise fill with silence
+ ALCdevice_Lock(device);
aluMixData(device, WritePtr1, WriteCnt1/FrameSize);
aluMixData(device, WritePtr2, WriteCnt2/FrameSize);
+ ALCdevice_Unlock(device);
// Unlock output buffer only when successfully locked
IDirectSoundBuffer_Unlock(self->Buffer, WritePtr1, WriteCnt1, WritePtr2, WriteCnt2);