[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.19-374-gff2091b

Colin Guthrie gitmailer-noreply at 0pointer.de
Thu Feb 11 15:33:10 PST 2010


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  66cfa72eb4fd4669dfd7e465c07c41bb7e6d3d85 (commit)

- Log -----------------------------------------------------------------
ff2091b pacat: Don't use any buffer attr if we don't set any latency/process time params
-----------------------------------------------------------------------

Summary of changes:
 src/utils/pacat.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

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

commit ff2091b2c47dfa7d9f1397627b72d9366b60f566
Author: Colin Guthrie <cguthrie at mandriva.org>
Date:   Thu Feb 11 23:33:19 2010 +0000

    pacat: Don't use any buffer attr if we don't set any latency/process time params

diff --git a/src/utils/pacat.c b/src/utils/pacat.c
index 1036af6..68280e5 100644
--- a/src/utils/pacat.c
+++ b/src/utils/pacat.c
@@ -409,6 +409,7 @@ static void context_state_callback(pa_context *c, void *userdata) {
 
         case PA_CONTEXT_READY: {
             pa_buffer_attr buffer_attr;
+            const pa_buffer_attr *active_buffer_attr = NULL;
 
             pa_assert(c);
             pa_assert(!stream);
@@ -438,29 +439,33 @@ static void context_state_callback(pa_context *c, void *userdata) {
 
             if (latency_msec > 0) {
                 buffer_attr.fragsize = buffer_attr.tlength = pa_usec_to_bytes(latency_msec * PA_USEC_PER_MSEC, &sample_spec);
+                active_buffer_attr = &buffer_attr;
                 flags |= PA_STREAM_ADJUST_LATENCY;
             } else if (latency > 0) {
                 buffer_attr.fragsize = buffer_attr.tlength = (uint32_t) latency;
+                active_buffer_attr = &buffer_attr;
                 flags |= PA_STREAM_ADJUST_LATENCY;
             } else
                 buffer_attr.fragsize = buffer_attr.tlength = (uint32_t) -1;
 
             if (process_time_msec > 0) {
                 buffer_attr.minreq = pa_usec_to_bytes(process_time_msec * PA_USEC_PER_MSEC, &sample_spec);
-            } else if (process_time > 0)
+                active_buffer_attr = &buffer_attr;
+            } else if (process_time > 0) {
                 buffer_attr.minreq = (uint32_t) process_time;
-            else
+                active_buffer_attr = &buffer_attr;
+            } else
                 buffer_attr.minreq = (uint32_t) -1;
 
             if (mode == PLAYBACK) {
                 pa_cvolume cv;
-                if (pa_stream_connect_playback(stream, device, &buffer_attr, flags, volume_is_set ? pa_cvolume_set(&cv, sample_spec.channels, volume) : NULL, NULL) < 0) {
+                if (pa_stream_connect_playback(stream, device, active_buffer_attr, flags, volume_is_set ? pa_cvolume_set(&cv, sample_spec.channels, volume) : NULL, NULL) < 0) {
                     pa_log(_("pa_stream_connect_playback() failed: %s"), pa_strerror(pa_context_errno(c)));
                     goto fail;
                 }
 
             } else {
-                if (pa_stream_connect_record(stream, device, latency > 0 ? &buffer_attr : NULL, flags) < 0) {
+                if (pa_stream_connect_record(stream, device, active_buffer_attr, flags) < 0) {
                     pa_log(_("pa_stream_connect_record() failed: %s"), pa_strerror(pa_context_errno(c)));
                     goto fail;
                 }

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list