[pulseaudio-discuss] [PATCH 4/8] sink, source: Fix default and alternate rate assertions

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


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

diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index a4ad21a..ae6ae8f 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -1412,8 +1412,8 @@ bool pa_sink_update_rate(pa_sink *s, uint32_t rate, bool passthrough) {
         return false;
 
     if (!passthrough) {
-        pa_assert(default_rate % 4000 || default_rate % 11025);
-        pa_assert(alternate_rate % 4000 || alternate_rate % 11025);
+        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 */
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 55f85d0..a9f515e 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -995,8 +995,8 @@ bool pa_source_update_rate(pa_source *s, uint32_t rate, bool passthrough) {
         return false;
 
     if (!passthrough) {
-        pa_assert(default_rate % 4000 || default_rate % 11025);
-        pa_assert(alternate_rate % 4000 || alternate_rate % 11025);
+        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 */
-- 
1.8.1.2



More information about the pulseaudio-discuss mailing list