From: Tanu Kaskinen Date: Fri, 9 Aug 2013 06:38:02 +0000 (+0300) Subject: sink, source: Return early from pa_*_update_rate(), if there's no need to do anything X-Git-Tag: accepted/tizen/20131022.162753~180 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1cd6a3ad70f04511c45bd41b0533e77c03ad8a3e;p=platform%2Fupstream%2Fpulseaudio.git sink, source: Return early from pa_*_update_rate(), if there's no need to do anything --- diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c index 2c33af4..bc8a3fd 100644 --- a/src/pulsecore/sink.c +++ b/src/pulsecore/sink.c @@ -1386,6 +1386,9 @@ bool pa_sink_update_rate(pa_sink *s, uint32_t rate, bool passthrough) { pa_sink_input *i; bool use_alternate = false; + if (rate == s->sample_spec.rate) + return true; + if (!s->update_rate) return false; diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c index 3293812..5cb6b73 100644 --- a/src/pulsecore/source.c +++ b/src/pulsecore/source.c @@ -976,6 +976,9 @@ bool pa_source_update_rate(pa_source *s, uint32_t rate, bool passthrough) { pa_source_output *o; bool use_alternate = false; + if (rate == s->sample_spec.rate) + return true; + if (!s->update_rate) return false;