From: Arun Raghavan Date: Mon, 7 Nov 2011 06:01:42 +0000 (+0530) Subject: sink,source: Fix corked stream handling in update_rate() X-Git-Tag: v1.99.1~190 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=75573435a026b39ecc7dba9435a1acba2b0dd937;p=platform%2Fupstream%2Fpulseaudio.git 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 ");