[pulseaudio-commits] src/pulsecore

Tanu Kaskinen tanuk at kemper.freedesktop.org
Thu Feb 7 01:23:23 PST 2013


 src/pulsecore/memblockq.c |    3 +--
 src/pulsecore/memblockq.h |    2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 7e6e3b7044ba47772dbaeea0ef71842ec799f7c6
Author: Jarkko Suontausta <jarkko.suontausta at digia.com>
Date:   Thu May 24 10:38:22 2012 +0300

    core: Assert on memchunk divisibility by sample spec in pa_memblockq_push().
    
    Earlier, -1 was returned if the memchunk size was not a multiple of the frame
    size. Now, it is verified unconditionally through an assertion. Error code -1
    is still returned when the memblock queue is full.
    
    In those few cases where the return value of pa_memblockq_push() is checked,
    an overflow is assumed to be the reason in case an error code is returned.

diff --git a/src/pulsecore/memblockq.c b/src/pulsecore/memblockq.c
index 4eeb4d6..0c245d2 100644
--- a/src/pulsecore/memblockq.c
+++ b/src/pulsecore/memblockq.c
@@ -287,8 +287,7 @@ int pa_memblockq_push(pa_memblockq* bq, const pa_memchunk *uchunk) {
     pa_assert(uchunk->length > 0);
     pa_assert(uchunk->index + uchunk->length <= pa_memblock_get_length(uchunk->memblock));
 
-    if (uchunk->length % bq->base)
-        return -1;
+    pa_assert_se(uchunk->length % bq->base == 0);
 
     if (!can_push(bq, uchunk->length))
         return -1;
diff --git a/src/pulsecore/memblockq.h b/src/pulsecore/memblockq.h
index 83a5415..88906ba 100644
--- a/src/pulsecore/memblockq.h
+++ b/src/pulsecore/memblockq.h
@@ -51,7 +51,7 @@ typedef struct pa_memblockq pa_memblockq;
 
    - ss:        Sample spec describing the queue contents. Only multiples
                 of the frame size as implied by the sample spec are
-                popped from the queue or should be pushed into it.
+                allowed into the queue or can be popped from it.
 
    - prebuf:    If the queue runs empty wait until this many bytes are in
                 queue again before passing the first byte out. If set



More information about the pulseaudio-commits mailing list