sink, source: Return early from pa_*_update_rate(), if there's no need to do anything
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Fri, 9 Aug 2013 06:38:02 +0000 (09:38 +0300)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Tue, 27 Aug 2013 09:02:32 +0000 (12:02 +0300)
src/pulsecore/sink.c
src/pulsecore/source.c

index 2c33af4..bc8a3fd 100644 (file)
@@ -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;
 
index 3293812..5cb6b73 100644 (file)
@@ -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;