[pulseaudio-commits] r2227 - in /branches/glitch-free/src/modules: module-alsa-sink.c module-alsa-source.c module-ladspa-sink.c module-remap-sink.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Tue Apr 8 18:18:05 PDT 2008


Author: lennart
Date: Wed Apr  9 03:18:05 2008
New Revision: 2227

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2227&root=pulseaudio&view=rev
Log:
init min/max latency properly; fix avail_min updating

Modified:
    branches/glitch-free/src/modules/module-alsa-sink.c
    branches/glitch-free/src/modules/module-alsa-source.c
    branches/glitch-free/src/modules/module-ladspa-sink.c
    branches/glitch-free/src/modules/module-remap-sink.c

Modified: branches/glitch-free/src/modules/module-alsa-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/modules/module-alsa-sink.c?rev=2227&root=pulseaudio&r1=2226&r2=2227&view=diff
==============================================================================
--- branches/glitch-free/src/modules/module-alsa-sink.c (original)
+++ branches/glitch-free/src/modules/module-alsa-sink.c Wed Apr  9 03:18:05 2008
@@ -436,7 +436,7 @@
 
     pa_assert(u);
 
-    usec = pa_sink_get_requested_latency(u->sink);
+    usec = pa_sink_get_requested_latency_within_thread(u->sink);
 
     if (usec <= 0)
         usec = pa_bytes_to_usec(u->hwbuf_size, &u->sink->sample_spec);
@@ -461,7 +461,7 @@
 
     pa_assert(u);
 
-    if ((usec = pa_sink_get_requested_latency(u->sink)) <= 0) {
+    if ((usec = pa_sink_get_requested_latency_within_thread(u->sink)) <= 0) {
         /* Use the full buffer if noone asked us for anything
          * specific */
         u->hwbuf_unused_frames = 0;
@@ -498,8 +498,6 @@
 
     } else
         avail_min = 1;
-
-    avail_min = (snd_pcm_uframes_t) -1;
 
     pa_log("setting avail_min=%lu", (unsigned long) avail_min);
 
@@ -1222,8 +1220,10 @@
 
     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 = pa_bytes_to_usec(u->hwbuf_size, &ss);
+        u->sink->min_latency = u->sink->max_latency;
 
     pa_log_info("Using %u fragments of size %lu bytes, buffer time is %0.2fms",
                 nfrags, (long unsigned) u->fragment_size,

Modified: branches/glitch-free/src/modules/module-alsa-source.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/modules/module-alsa-source.c?rev=2227&root=pulseaudio&r1=2226&r2=2227&view=diff
==============================================================================
--- branches/glitch-free/src/modules/module-alsa-source.c (original)
+++ branches/glitch-free/src/modules/module-alsa-source.c Wed Apr  9 03:18:05 2008
@@ -411,7 +411,7 @@
 
     pa_assert(u);
 
-    usec = pa_source_get_requested_latency(u->source);
+    usec = pa_source_get_requested_latency_within_thread(u->source);
 
     if (usec <= 0)
         usec = pa_bytes_to_usec(u->hwbuf_size, &u->source->sample_spec);
@@ -1093,8 +1093,10 @@
     u->hw_dB_min = u->hw_dB_max = 0;
     u->hw_volume_min = u->hw_volume_max = 0;
 
+    u->source->max_latency = pa_bytes_to_usec(u->hwbuf_size, &ss);
+
     if (!use_tsched)
-        u->source->min_latency = pa_bytes_to_usec(u->hwbuf_size, &ss);
+        u->source->min_latency = u->source->max_latency;
 
     pa_log_info("Using %u fragments of size %lu bytes, buffer time is %0.2fms",
                 nfrags, (long unsigned) u->fragment_size,

Modified: branches/glitch-free/src/modules/module-ladspa-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/modules/module-ladspa-sink.c?rev=2227&root=pulseaudio&r1=2226&r2=2227&view=diff
==============================================================================
--- branches/glitch-free/src/modules/module-ladspa-sink.c (original)
+++ branches/glitch-free/src/modules/module-ladspa-sink.c Wed Apr  9 03:18:05 2008
@@ -145,7 +145,7 @@
     pa_assert_se(u = s->userdata);
 
     /* Just hand this one over to the master sink */
-    u->sink_input->thread_info.requested_sink_latency = pa_sink_get_requested_latency(s);
+    u->sink_input->thread_info.requested_sink_latency = pa_sink_get_requested_latency_within_thread(s);
     pa_sink_invalidate_requested_latency(u->master);
 }
 

Modified: branches/glitch-free/src/modules/module-remap-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/modules/module-remap-sink.c?rev=2227&root=pulseaudio&r1=2226&r2=2227&view=diff
==============================================================================
--- branches/glitch-free/src/modules/module-remap-sink.c (original)
+++ branches/glitch-free/src/modules/module-remap-sink.c Wed Apr  9 03:18:05 2008
@@ -123,7 +123,7 @@
     pa_assert_se(u = s->userdata);
 
     /* Just hand this one over to the master sink */
-    u->sink_input->thread_info.requested_sink_latency = pa_sink_get_requested_latency(s);
+    u->sink_input->thread_info.requested_sink_latency = pa_sink_get_requested_latency_within_thread(s);
     pa_sink_invalidate_requested_latency(u->master);
 }
 




More information about the pulseaudio-commits mailing list