[PATCH] update process_usec before enter sleep

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: xingchao <xingchao.wang@xxxxxxxxx>

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



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux