Hold the device lock with PulseAudio between mixing and writing

This commit is contained in:
Chris Robinson
2012-08-18 17:20:20 -07:00
parent a56a974149
commit 0db7c4131b
+2
View File
@@ -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);