[pulseaudio-commits] r2459 - /trunk/src/modules/module-alsa-sink.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sat May 17 02:57:34 PDT 2008


Author: lennart
Date: Sat May 17 11:57:32 2008
New Revision: 2459

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2459&root=pulseaudio&view=rev
Log:
use pa_source_set_latency_range()/pa_sink_set_latency_range() in the ALSA drivers; fix sleep time calculation

Modified:
    trunk/src/modules/module-alsa-sink.c

Modified: trunk/src/modules/module-alsa-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-alsa-sink.c?rev=2459&root=pulseaudio&r1=2458&r2=2459&view=diff
==============================================================================
--- trunk/src/modules/module-alsa-sink.c (original)
+++ trunk/src/modules/module-alsa-sink.c Sat May 17 11:57:32 2008
@@ -277,7 +277,7 @@
             * need to guarantee that clients only have to keep around
             * a single hw buffer length. */
 
-            if (pa_bytes_to_usec(left_to_play, &u->sink->sample_spec) > max_sleep_usec/2)
+            if (pa_bytes_to_usec(left_to_play, &u->sink->sample_spec) > process_usec+max_sleep_usec/2)
                 break;
 
         if (PA_UNLIKELY(n <= u->hwbuf_unused_frames))
@@ -389,7 +389,7 @@
             * need to guarantee that clients only have to keep around
             * a single hw buffer length. */
 
-            if (pa_bytes_to_usec(left_to_play, &u->sink->sample_spec) > max_sleep_usec/2)
+            if (pa_bytes_to_usec(left_to_play, &u->sink->sample_spec) > process_usec+max_sleep_usec/2)
                 break;
 
         if (PA_UNLIKELY(n <= u->hwbuf_unused_frames))
@@ -1318,9 +1318,10 @@
         fix_tsched_watermark(u);
 
     u->sink->thread_info.max_rewind = use_tsched ? u->hwbuf_size : 0;
-    u->sink->max_latency = pa_bytes_to_usec(u->hwbuf_size, &ss);
-    if (!use_tsched)
-        u->sink->min_latency = u->sink->max_latency;
+
+    pa_sink_set_latency_range(u->sink,
+                              !use_tsched ? pa_bytes_to_usec(u->hwbuf_size, &ss) : (pa_usec_t) -1,
+                              pa_bytes_to_usec(u->hwbuf_size, &ss));
 
     pa_log_info("Using %u fragments of size %lu bytes, buffer time is %0.2fms",
                 nfrags, (long unsigned) u->fragment_size,




More information about the pulseaudio-commits mailing list