[pulseaudio-discuss] [PATCH 5/8] sink, source: Small readability improvement

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Thu Aug 8 23:57:56 PDT 2013


---
 src/pulsecore/sink.c   | 3 +--
 src/pulsecore/source.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index ae6ae8f..e9bfe72 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -1415,8 +1415,7 @@ bool pa_sink_update_rate(pa_sink *s, uint32_t rate, bool passthrough) {
         pa_assert((default_rate % 4000 == 0) || (default_rate % 11025 == 0));
         pa_assert((alternate_rate % 4000 == 0) || (alternate_rate % 11025 == 0));
 
-        if (default_rate % 4000) {
-            /* default is a 11025 multiple */
+        if (default_rate % 11025 == 0) {
             if ((alternate_rate % 4000 == 0) && (desired_rate % 4000 == 0))
                 use_alternate=true;
         } else {
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index a9f515e..57b7c85 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -998,8 +998,7 @@ bool pa_source_update_rate(pa_source *s, uint32_t rate, bool passthrough) {
         pa_assert((default_rate % 4000 == 0) || (default_rate % 11025 == 0));
         pa_assert((alternate_rate % 4000 == 0) || (alternate_rate % 11025 == 0));
 
-        if (default_rate % 4000) {
-            /* default is a 11025 multiple */
+        if (default_rate % 11025 == 0) {
             if ((alternate_rate % 4000 == 0) && (desired_rate % 4000 == 0))
                 use_alternate=true;
         } else {
-- 
1.8.1.2



More information about the pulseaudio-discuss mailing list