2eafd7
--- alsa-plugins-1.0.14/pulse/pcm_pulse.c	2007-05-31 10:06:51.000000000 +0200
2eafd7
+++ alsa-plugins-1.0.14.lennart/pulse/pcm_pulse.c	2007-09-24 01:43:01.000000000 +0200
2eafd7
@@ -57,7 +57,7 @@
2eafd7
 
2eafd7
     if (size > pcm->last_size) {
2eafd7
         pcm->ptr += size - pcm->last_size;
2eafd7
-        pcm->ptr %= pcm->buffer_attr.maxlength;
2eafd7
+        pcm->ptr %= pcm->buffer_attr.tlength;
2eafd7
     }
2eafd7
 
2eafd7
     pcm->last_size = size;
2eafd7
@@ -533,9 +533,9 @@
2eafd7
     pcm->ss.rate = io->rate;
2eafd7
     pcm->ss.channels = io->channels;
2eafd7
 
2eafd7
-    pcm->buffer_attr.maxlength = io->buffer_size * pcm->frame_size;
2eafd7
+    pcm->buffer_attr.maxlength = (io->buffer_size*3)/2 * pcm->frame_size;
2eafd7
     pcm->buffer_attr.tlength = io->buffer_size * pcm->frame_size;
2eafd7
-    pcm->buffer_attr.prebuf = io->period_size * pcm->frame_size;
2eafd7
+    pcm->buffer_attr.prebuf = (io->buffer_size-io->period_size) * pcm->frame_size;
2eafd7
     pcm->buffer_attr.minreq = io->period_size * pcm->frame_size;
2eafd7
     pcm->buffer_attr.fragsize = io->period_size * pcm->frame_size;
2eafd7