aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatthew Gregan <[email protected]>2012-05-07 16:53:12 +1200
committerMatthew Gregan <[email protected]>2012-05-07 16:53:12 +1200
commitda17df35fa3b22c447cc435c6f4753454ec7a7d2 (patch)
tree28e92fdafbb2adb337f454eaa7f9f58a4817be31
parentd7368445b56327015cad554cb62a4be31051ed4e (diff)
downloadcubeb-da17df35fa3b22c447cc435c6f4753454ec7a7d2.tar.gz
cubeb-da17df35fa3b22c447cc435c6f4753454ec7a7d2.zip
pulse: tweak minreq calculation per bmo# 751030.
-rw-r--r--src/cubeb_pulse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cubeb_pulse.c b/src/cubeb_pulse.c
index de86171..ad4c340 100644
--- a/src/cubeb_pulse.c
+++ b/src/cubeb_pulse.c
@@ -116,9 +116,9 @@ stream_request_callback(pa_stream * s, size_t nbytes, void * u)
if ((size_t) got < size / frame_size) {
size_t buffer_fill = pa_stream_get_buffer_attr(s)->maxlength - pa_stream_writable_size(s);
- double buffer_time = (double) buffer_fill / stm->sample_spec.rate;
+ pa_usec_t buffer_time = pa_bytes_to_usec(buffer_fill, &stm->sample_spec);
/* pa_stream_drain is useless, see PA bug# 866. this is a workaround. */
- stm->drain_timer = pa_context_rttime_new(stm->context->context, pa_rtclock_now() + buffer_time * 1e6, stream_drain_callback, stm);
+ stm->drain_timer = pa_context_rttime_new(stm->context->context, pa_rtclock_now() + buffer_time, stream_drain_callback, stm);
stm->shutdown = 1;
return;
}
@@ -295,7 +295,7 @@ cubeb_stream_init(cubeb * context, cubeb_stream ** stream, char const * stream_n
battr.maxlength = -1;
battr.tlength = pa_usec_to_bytes(latency * PA_USEC_PER_MSEC, &stm->sample_spec);
battr.prebuf = -1;
- battr.minreq = battr.tlength / 2;
+ battr.minreq = battr.tlength / 4;
battr.fragsize = -1;
pa_threaded_mainloop_lock(stm->context->mainloop);