Don't unlock the pulseaudio mainloop when mixing

Lock contention could cause a lengthy delay between mixing and writing the
audio. There shouldn't be any risk of dead-locking as the device lock should
never be held when the mainloop gets locked.
This commit is contained in:
Chris Robinson 2012-08-12 03:52:38 -07:00
parent 8304fc1bef
commit f42f655ea9

View File

@ -837,11 +837,9 @@ static ALuint PulseProc(ALvoid *param)
buf = pa_xmalloc(newlen);
free_func = pa_xfree;
}
pa_threaded_mainloop_unlock(data->loop);
aluMixData(Device, buf, newlen/frame_size);
pa_threaded_mainloop_lock(data->loop);
pa_stream_write(data->stream, buf, newlen, free_func, 0, PA_SEEK_RELATIVE);
len -= newlen;
}