[pulseaudio-commits] r2460 - /trunk/src/modules/module-alsa-source.c

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


Author: lennart
Date: Sat May 17 11:57:45 2008
New Revision: 2460

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2460&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-source.c

Modified: trunk/src/modules/module-alsa-source.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-alsa-source.c?rev=2460&root=pulseaudio&r1=2459&r2=2460&view=diff
==============================================================================
--- trunk/src/modules/module-alsa-source.c (original)
+++ trunk/src/modules/module-alsa-source.c Sat May 17 11:57:45 2008
@@ -262,7 +262,7 @@
         left_to_record = check_left_to_record(u, n);
 
         if (u->use_tsched)
-            if (pa_bytes_to_usec(left_to_record, &u->source->sample_spec) > max_sleep_usec/2)
+            if (pa_bytes_to_usec(left_to_record, &u->source->sample_spec) > process_usec+max_sleep_usec/2)
                 break;
 
         if (PA_UNLIKELY(n <= 0))
@@ -359,7 +359,7 @@
         left_to_record = check_left_to_record(u, n);
 
         if (u->use_tsched)
-            if (pa_bytes_to_usec(left_to_record, &u->source->sample_spec) > max_sleep_usec/2)
+            if (pa_bytes_to_usec(left_to_record, &u->source->sample_spec) > process_usec+max_sleep_usec/2)
                 break;
 
         if (PA_UNLIKELY(n <= 0))
@@ -1152,9 +1152,9 @@
     if (use_tsched)
         fix_tsched_watermark(u);
 
-    u->source->max_latency = pa_bytes_to_usec(u->hwbuf_size, &ss);
-    if (!use_tsched)
-        u->source->min_latency = u->source->max_latency;
+    pa_source_set_latency_range(u->source,
+                                !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