diff options
author | Chris Robinson <[email protected]> | 2010-01-24 00:03:23 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-01-24 00:03:23 -0800 |
commit | bd518ed26463bc83f975712275d7af0b69ec897d (patch) | |
tree | 2a87eb3fcee9bce2a3947ca397ba0cf203bb3d7e /Alc/pulseaudio.c | |
parent | 56379bffac509ccf03d4cbe2c7761e4042304e9b (diff) |
Make sure all requested data gets written to PulseAudio
Diffstat (limited to 'Alc/pulseaudio.c')
-rw-r--r-- | Alc/pulseaudio.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c index 69d80703..dbc29b90 100644 --- a/Alc/pulseaudio.c +++ b/Alc/pulseaudio.c @@ -421,22 +421,24 @@ static void stream_write_callback(pa_stream *stream, size_t len, void *pdata) // pulse_data *data = Device->ExtraData; len -= len%data->attr.minreq; - if(len > 0) + while(len > 0) { + size_t newlen = len; void *buf; pa_free_cb_t free_func = NULL; #if PA_CHECK_VERSION(0,9,16) if(!ppa_stream_begin_write || - ppa_stream_begin_write(stream, &buf, &len) < 0) + ppa_stream_begin_write(stream, &buf, &newlen) < 0) #endif { - buf = ppa_xmalloc(len); + buf = ppa_xmalloc(newlen); free_func = ppa_xfree; } - aluMixData(Device, buf, len/data->frame_size); - ppa_stream_write(stream, buf, len, free_func, 0, PA_SEEK_RELATIVE); + aluMixData(Device, buf, newlen/data->frame_size); + ppa_stream_write(stream, buf, newlen, free_func, 0, PA_SEEK_RELATIVE); + len -= newlen; } } //}}} //}}} |