[pulseaudio-commits] r2341 - /branches/glitch-free/src/pulsecore/memblockq.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Thu May 1 18:20:47 PDT 2008


Author: lennart
Date: Fri May  2 03:20:46 2008
New Revision: 2341

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2341&root=pulseaudio&view=rev
Log:
don't enable prebuffering if we just call is_readable()

Modified:
    branches/glitch-free/src/pulsecore/memblockq.c

Modified: branches/glitch-free/src/pulsecore/memblockq.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/pulsecore/memblockq.c?rev=2341&root=pulseaudio&r1=2340&r2=2341&view=diff
==============================================================================
--- branches/glitch-free/src/pulsecore/memblockq.c (original)
+++ branches/glitch-free/src/pulsecore/memblockq.c Fri May  2 03:20:46 2008
@@ -428,6 +428,15 @@
 pa_bool_t pa_memblockq_prebuf_active(pa_memblockq *bq) {
     pa_assert(bq);
 
+    if (bq->in_prebuf)
+        return pa_memblockq_get_length(bq) < bq->prebuf;
+    else
+        return bq->prebuf > 0 && bq->read_index >= bq->write_index;
+}
+
+static pa_bool_t update_prebuf(pa_memblockq *bq) {
+    pa_assert(bq);
+
     if (bq->in_prebuf) {
 
         if (pa_memblockq_get_length(bq) < bq->prebuf)
@@ -452,7 +461,7 @@
     pa_assert(chunk);
 
     /* We need to pre-buffer */
-    if (pa_memblockq_prebuf_active(bq))
+    if (update_prebuf(bq))
         return -1;
 
     fix_current_read(bq);
@@ -515,7 +524,7 @@
     while (length > 0) {
 
         /* Do not drop any data when we are in prebuffering mode */
-        if (pa_memblockq_prebuf_active(bq))
+        if (update_prebuf(bq))
             break;
 
         fix_current_read(bq);




More information about the pulseaudio-commits mailing list