From ae63ca481d9f926bbf3bcfc2fc20aff88180246a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 31 Oct 2009 17:59:30 -0700 Subject: [PATCH] Mix all updates PulseAudio requests --- Alc/pulseaudio.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c index 3962a27c..cbd53476 100644 --- a/Alc/pulseaudio.c +++ b/Alc/pulseaudio.c @@ -261,12 +261,14 @@ static void stream_write_callback(pa_stream *stream, size_t len, void *pdata) // { ALCdevice *Device = pdata; pulse_data *data = Device->ExtraData; - void *buf = ppa_xmalloc0(data->attr.minreq); - (void)len; - aluMixData(Device, buf, data->attr.minreq/data->frame_size); - ppa_stream_write(stream, buf, data->attr.minreq, ppa_xfree, 0, - PA_SEEK_RELATIVE); + len -= len&data->attr.minreq; + if(len > 0) + { + void *buf = ppa_xmalloc0(len); + aluMixData(Device, buf, len/data->frame_size); + ppa_stream_write(stream, buf, len, ppa_xfree, 0, PA_SEEK_RELATIVE); + } } //}}} static void stream_read_callback(pa_stream *stream, size_t length, void *pdata) //{{{