summaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-08-18 17:20:20 -0700
committerChris Robinson <[email protected]>2012-08-18 17:20:20 -0700
commit0db7c4131b9b1da7a70c845a2ff3e5ab62c67e20 (patch)
treeee83ddce380bb0d2460cdd5bec258cb83e9be56c /Alc
parenta56a9741495e53dcccfe611047d36011010c5657 (diff)
Hold the device lock with PulseAudio between mixing and writing
Diffstat (limited to 'Alc')
-rw-r--r--Alc/backends/pulseaudio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c
index de8a40d0..059f841a 100644
--- a/Alc/backends/pulseaudio.c
+++ b/Alc/backends/pulseaudio.c
@@ -826,6 +826,7 @@ static ALuint PulseProc(ALvoid *param)
}
len -= len%update_size;
+ ALCdevice_Lock(Device);
while(len > 0)
{
size_t newlen = len;
@@ -846,6 +847,7 @@ static ALuint PulseProc(ALvoid *param)
pa_stream_write(data->stream, buf, newlen, free_func, 0, PA_SEEK_RELATIVE);
len -= newlen;
}
+ ALCdevice_Unlock(Device);
} while(!data->killNow && Device->Connected);
pa_threaded_mainloop_unlock(data->loop);