[pulseaudio-commits] src/pulsecore

Arun Raghavan arun at kemper.freedesktop.org
Mon Nov 7 00:04:45 PST 2011


 src/pulsecore/sink.c   |    7 ++++---
 src/pulsecore/source.c |    7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 75573435a026b39ecc7dba9435a1acba2b0dd937
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Mon Nov 7 11:31:42 2011 +0530

    sink,source: Fix corked stream handling in update_rate()
    
    This fixes the conditional that checks for corked streams and prevents
    rate updates.

diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index eb67b47..99acb2f 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -1385,9 +1385,10 @@ pa_bool_t pa_sink_update_rate(pa_sink *s, uint32_t rate, pa_bool_t passthrough)
             desired_rate = rate; /* use stream sampling rate, discard default/alternate settings */
         }
 
-        if (passthrough || pa_sink_linked_by(s) == 0) {
-            pa_sink_suspend(s, TRUE, PA_SUSPEND_IDLE); /* needed before rate update, will be resumed automatically */
-        }
+        if (!passthrough && pa_sink_linked_by(s) > 0)
+            return FALSE;
+
+        pa_sink_suspend(s, TRUE, PA_SUSPEND_IDLE); /* needed before rate update, will be resumed automatically */
 
         if (s->update_rate(s, desired_rate) == TRUE) {
             /* update monitor source as well */
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 361780a..ac81492 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -972,9 +972,10 @@ pa_bool_t pa_source_update_rate(pa_source *s, uint32_t rate, pa_bool_t passthrou
             desired_rate = rate; /* use stream sampling rate, discard default/alternate settings */
         }
 
-        if (passthrough || pa_source_linked_by(s) == 0) {
-            pa_source_suspend(s, TRUE, PA_SUSPEND_IDLE); /* needed before rate update, will be resumed automatically */
-        }
+        if (!passthrough && pa_source_linked_by(s) > 0)
+            return FALSE;
+
+        pa_source_suspend(s, TRUE, PA_SUSPEND_IDLE); /* needed before rate update, will be resumed automatically */
 
         if (s->update_rate(s, desired_rate) == TRUE) {
             pa_log_info("Changed sampling rate successfully ");



More information about the pulseaudio-commits mailing list