From 14255a38fcc36ba87ee2aa7b867845b13a44c573 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 14 Mar 2010 21:45:23 -0700 Subject: [PATCH] Pulse's buffer size is not a good measurement for the update size Lie and say 20ms instead, since there is no stable method to get such info --- Alc/pulseaudio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c index 8c71acd1..c8352b6b 100644 --- a/Alc/pulseaudio.c +++ b/Alc/pulseaudio.c @@ -305,8 +305,10 @@ static void stream_buffer_attr_callback(pa_stream *stream, void *pdata) //{{{ SuspendContext(NULL); data->attr = *(ppa_stream_get_buffer_attr(stream)); - Device->UpdateSize = data->attr.tlength/data->frame_size; - Device->NumUpdates = 1; + Device->UpdateSize = 20 * Device->Frequency / 1000; + Device->NumUpdates = data->attr.tlength/data->frame_size / Device->UpdateSize; + if(Device->NumUpdates == 0) + Device->NumUpdates = 1; ProcessContext(NULL); }//}}} -- 2.11.4.GIT