[pulseaudio-discuss] [PATCH] update process_usec before enter sleep
wangxingchao2011 at gmail.com
wangxingchao2011 at gmail.com
Fri Aug 5 09:48:03 PDT 2011
From: xingchao <xingchao.wang at intel.com>
during mmap_write(), there's chance to increase/decrease watermark. So before
sleep, the actural sleep time should based on latest watermark.
---
src/modules/alsa/alsa-sink.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index dd2546c..7746f45 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -787,6 +787,7 @@ static int unix_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle
if (u->use_tsched) {
*sleep_usec = pa_bytes_to_usec(left_to_play, &u->sink->sample_spec);
+ process_usec = pa_bytes_to_usec(u->tsched_watermark, &u->sink->sample_spec);
if (*sleep_usec > process_usec)
*sleep_usec -= process_usec;
--
1.7.1
More information about the pulseaudio-discuss
mailing list