diff options
author | Chris Robinson <[email protected]> | 2012-02-22 18:33:28 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-02-22 18:33:28 -0800 |
commit | 973b92b8fd4f6e70376f873346ffb610f10afa5c (patch) | |
tree | f5714f2768c3db89a568d819f8c485d5f436e61a /Alc | |
parent | 6ba0fd25a24f1bb27a31db2911976d6c8952cff7 (diff) |
Minor rearrangements for the pulseaudio mixing loop
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/backends/pulseaudio.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c index 7c961563..b93a90d8 100644 --- a/Alc/backends/pulseaudio.c +++ b/Alc/backends/pulseaudio.c @@ -616,19 +616,19 @@ static ALuint PulseProc(ALvoid *param) { ALCdevice *Device = param; pulse_data *data = Device->ExtraData; - ssize_t len; + size_t len; SetRTPriority(); pa_threaded_mainloop_lock(data->loop); do { - len = (Device->Connected ? pa_stream_writable_size(data->stream) : 0); - len -= len%data->attr.minreq; - if(len == 0) + len = pa_stream_writable_size(data->stream); + if(len < data->attr.minreq) { pa_threaded_mainloop_wait(data->loop); continue; } + len -= len%data->attr.minreq; while(len > 0) { @@ -652,7 +652,7 @@ static ALuint PulseProc(ALvoid *param) pa_stream_write(data->stream, buf, newlen, free_func, 0, PA_SEEK_RELATIVE); len -= newlen; } - } while(Device->Connected && !data->killNow); + } while(!data->killNow && Device->Connected); pa_threaded_mainloop_unlock(data->loop); return 0; |