aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/pulseaudio.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-03-14 21:45:23 -0700
committerChris Robinson <[email protected]>2010-03-14 21:45:23 -0700
commit14255a38fcc36ba87ee2aa7b867845b13a44c573 (patch)
treeffa8f906f71b16e70f7c7f090d6097f64649f82e /Alc/pulseaudio.c
parent6c5f1b78d742d20b7c8b9dd8a493f825156a5079 (diff)
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
Diffstat (limited to 'Alc/pulseaudio.c')
-rw-r--r--Alc/pulseaudio.c6
1 files 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);
}//}}}