diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c index eb67b47a1..99acb2fc7 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 361780aeb..ac814925e 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 ");