[pulseaudio-commits] 3 commits - src/modules src/pulsecore src/tests

Peter Meerwald pmeerw at kemper.freedesktop.org
Sun Nov 9 13:24:37 PST 2014


 src/modules/echo-cancel/module-echo-cancel.c |    6 +++---
 src/modules/module-console-kit.c             |    2 +-
 src/modules/module-solaris.c                 |    6 +++---
 src/pulsecore/log.h                          |    2 +-
 src/pulsecore/memchunk.c                     |    2 +-
 src/pulsecore/mix.c                          |    4 ++--
 src/pulsecore/pipe.c                         |    2 +-
 src/tests/flist-test.c                       |    2 +-
 src/tests/mcalign-test.c                     |    3 +--
 9 files changed, 14 insertions(+), 15 deletions(-)

New commits:
commit 101092465db158c69720d2ff6789d6b31be656bc
Author: Peter Meerwald <pmeerw at pmeerw.net>
Date:   Sun Nov 9 17:49:54 2014 +0100

    core: Replace assert()s with pa_assert()s
    
    Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>

diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index c755119..eed4830 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -1559,14 +1559,14 @@ uint32_t pa_echo_canceller_blocksize_power2(unsigned rate, unsigned ms) {
     unsigned nframes = (rate * ms) / 1000;
     uint32_t y = 1 << ((8 * sizeof(uint32_t)) - 2);
 
-    assert(rate >= 4000);
-    assert(ms >= 1);
+    pa_assert(rate >= 4000);
+    pa_assert(ms >= 1);
 
     /* nframes should be a power of 2, round down to nearest power of two */
     while (y > nframes)
         y >>= 1;
 
-    assert(y >= 1);
+    pa_assert(y >= 1);
     return y;
 }
 
diff --git a/src/modules/module-console-kit.c b/src/modules/module-console-kit.c
index 0fed15f..c8a35d4 100644
--- a/src/modules/module-console-kit.c
+++ b/src/modules/module-console-kit.c
@@ -240,7 +240,7 @@ static int get_session_list(struct userdata *u) {
         if ((at = dbus_message_iter_get_arg_type(&sub)) == DBUS_TYPE_INVALID)
             break;
 
-        assert(at == DBUS_TYPE_OBJECT_PATH);
+        pa_assert(at == DBUS_TYPE_OBJECT_PATH);
         dbus_message_iter_get_basic(&sub, &id);
 
         add_session(u, id);
diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c
index 4f11000..abde50a 100644
--- a/src/modules/module-solaris.c
+++ b/src/modules/module-solaris.c
@@ -495,7 +495,7 @@ static void sink_set_volume(pa_sink *s) {
         AUDIO_INITINFO(&info);
 
         info.play.gain = pa_cvolume_max(&s->real_volume) * AUDIO_MAX_GAIN / PA_VOLUME_NORM;
-        assert(info.play.gain <= AUDIO_MAX_GAIN);
+        pa_assert(info.play.gain <= AUDIO_MAX_GAIN);
 
         if (ioctl(u->fd, AUDIO_SETINFO, &info) < 0) {
             if (errno == EINVAL)
@@ -530,7 +530,7 @@ static void source_set_volume(pa_source *s) {
         AUDIO_INITINFO(&info);
 
         info.play.gain = pa_cvolume_max(&s->real_volume) * AUDIO_MAX_GAIN / PA_VOLUME_NORM;
-        assert(info.play.gain <= AUDIO_MAX_GAIN);
+        pa_assert(info.play.gain <= AUDIO_MAX_GAIN);
 
         if (ioctl(u->fd, AUDIO_SETINFO, &info) < 0) {
             if (errno == EINVAL)
@@ -817,7 +817,7 @@ finish:
 static void sig_callback(pa_mainloop_api *api, pa_signal_event*e, int sig, void *userdata) {
     struct userdata *u = userdata;
 
-    assert(u);
+    pa_assert(u);
 
     pa_log_debug("caught signal");
 
diff --git a/src/pulsecore/memchunk.c b/src/pulsecore/memchunk.c
index 5f8545f..792b4c7 100644
--- a/src/pulsecore/memchunk.c
+++ b/src/pulsecore/memchunk.c
@@ -111,7 +111,7 @@ pa_memchunk* pa_memchunk_memcpy(pa_memchunk *dst, pa_memchunk *src) {
 }
 
 bool pa_memchunk_isset(pa_memchunk *chunk) {
-    assert(chunk);
+    pa_assert(chunk);
 
     return
         chunk->memblock ||
diff --git a/src/pulsecore/pipe.c b/src/pulsecore/pipe.c
index 4e3c0c3..6ca1626 100644
--- a/src/pulsecore/pipe.c
+++ b/src/pulsecore/pipe.c
@@ -41,7 +41,7 @@ static int set_block(int fd, int blocking) {
 
     int v;
 
-    assert(fd >= 0);
+    pa_assert(fd >= 0);
 
     if ((v = fcntl(fd, F_GETFL)) < 0)
         return -1;
diff --git a/src/tests/flist-test.c b/src/tests/flist-test.c
index 6915204..d8c227a 100644
--- a/src/tests/flist-test.c
+++ b/src/tests/flist-test.c
@@ -88,7 +88,7 @@ int main(int argc, char* argv[]) {
 
     for (i = 0; i < THREADS_MAX; i++) {
         threads[i] = pa_thread_new("test", thread_func, pa_sprintf_malloc("Thread #%i", i+1));
-        assert(threads[i]);
+        pa_assert(threads[i]);
     }
 
     pa_msleep(60000);
diff --git a/src/tests/mcalign-test.c b/src/tests/mcalign-test.c
index 443b4a7..455e18c 100644
--- a/src/tests/mcalign-test.c
+++ b/src/tests/mcalign-test.c
@@ -21,7 +21,6 @@
 #include <config.h>
 #endif
 
-#include <assert.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <errno.h>
@@ -56,7 +55,7 @@ int main(int argc, char *argv[]) {
             c.index = c.length = 0;
         }
 
-        assert(c.index < pa_memblock_get_length(c.memblock));
+        pa_assert(c.index < pa_memblock_get_length(c.memblock));
 
         l = pa_memblock_get_length(c.memblock) - c.index;
 

commit 59334021d3c77a4a2c5f79e1fd72870472ddf43c
Author: Peter Meerwald <pmeerw at pmeerw.net>
Date:   Sat Nov 8 17:36:10 2014 +0100

    log: Cleanup
    
    Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>

diff --git a/src/pulsecore/log.h b/src/pulsecore/log.h
index 14ae857..65abed9 100644
--- a/src/pulsecore/log.h
+++ b/src/pulsecore/log.h
@@ -48,7 +48,7 @@ typedef enum pa_log_level {
     PA_LOG_WARN   = 1,    /* Warning messages */
     PA_LOG_NOTICE = 2,    /* Notice messages */
     PA_LOG_INFO   = 3,    /* Info messages */
-    PA_LOG_DEBUG  = 4,    /* debug message */
+    PA_LOG_DEBUG  = 4,    /* Debug messages */
     PA_LOG_LEVEL_MAX
 } pa_log_level_t;
 

commit b9aafdd73614cc41d1747ce4a33d21ec8d5e6c96
Author: Peter Meerwald <pmeerw at pmeerw.net>
Date:   Fri Oct 31 23:46:33 2014 +0100

    mix: Make use of pa_cvolume_is_norm/muted() macros
    
    Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>

diff --git a/src/pulsecore/mix.c b/src/pulsecore/mix.c
index 06b22bd..4a839ec 100644
--- a/src/pulsecore/mix.c
+++ b/src/pulsecore/mix.c
@@ -707,10 +707,10 @@ void pa_volume_memchunk(
     if (pa_memblock_is_silence(c->memblock))
         return;
 
-    if (pa_cvolume_channels_equal_to(volume, PA_VOLUME_NORM))
+    if (pa_cvolume_is_norm(volume))
         return;
 
-    if (pa_cvolume_channels_equal_to(volume, PA_VOLUME_MUTED)) {
+    if (pa_cvolume_is_muted(volume)) {
         pa_silence_memchunk(c, spec);
         return;
     }



More information about the pulseaudio-commits mailing list