[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.12-133-ga9c1bb3

Lennart Poettering gitmailer-noreply at 0pointer.de
Fri Oct 3 17:14:14 PDT 2008


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  83b1d7a305dfdf0a6958ba28a84cd1a074ca7aff (commit)

- Log -----------------------------------------------------------------
a9c1bb3... substract the unused record buffer size from the overall size before calculating the space still left for recording
-----------------------------------------------------------------------

Summary of changes:
 src/modules/module-alsa-sink.c   |    2 +-
 src/modules/module-alsa-source.c |    7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

-----------------------------------------------------------------------

commit a9c1bb3e85b1a9776e9291ea24ef1847dc991e2a
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Oct 4 02:13:39 2008 +0200

    substract the unused record buffer size from the overall size before calculating the space still left for recording

diff --git a/src/modules/module-alsa-sink.c b/src/modules/module-alsa-sink.c
index c42da36..0e15da3 100644
--- a/src/modules/module-alsa-sink.c
+++ b/src/modules/module-alsa-sink.c
@@ -569,7 +569,7 @@ static int update_sw_params(struct userdata *u) {
         if ((latency = pa_sink_get_requested_latency_within_thread(u->sink)) != (pa_usec_t) -1) {
             size_t b;
 
-            pa_log_debug("latency set to %0.2f", (double) latency / PA_USEC_PER_MSEC);
+            pa_log_debug("latency set to %0.2fms", (double) latency / PA_USEC_PER_MSEC);
 
             b = pa_usec_to_bytes(latency, &u->sink->sample_spec);
 
diff --git a/src/modules/module-alsa-source.c b/src/modules/module-alsa-source.c
index e1fe4d6..2827ecf 100644
--- a/src/modules/module-alsa-source.c
+++ b/src/modules/module-alsa-source.c
@@ -211,9 +211,10 @@ static int try_recover(struct userdata *u, const char *call, int err) {
 
 static size_t check_left_to_record(struct userdata *u, snd_pcm_sframes_t n) {
     size_t left_to_record;
+    size_t rec_space = u->hwbuf_size - (size_t) u->hwbuf_unused_frames*u->frame_size;
 
-    if ((size_t) n*u->frame_size < u->hwbuf_size)
-        left_to_record = u->hwbuf_size - ((size_t) n*u->frame_size);
+    if ((size_t) n*u->frame_size < rec_space)
+        left_to_record = rec_space - ((size_t) n*u->frame_size);
     else
         left_to_record = 0;
 
@@ -514,7 +515,7 @@ static int update_sw_params(struct userdata *u) {
         if ((latency = pa_source_get_requested_latency_within_thread(u->source)) != (pa_usec_t) -1) {
             size_t b;
 
-            pa_log_debug("latency set to %0.2f", (double) latency / PA_USEC_PER_MSEC);
+            pa_log_debug("latency set to %0.2fms", (double) latency / PA_USEC_PER_MSEC);
 
             b = pa_usec_to_bytes(latency, &u->source->sample_spec);
 

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list