[pulseaudio-commits] r2305 - /branches/glitch-free/src/pulsecore/source-output.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Wed Apr 23 11:14:27 PDT 2008


Author: lennart
Date: Wed Apr 23 20:14:25 2008
New Revision: 2305

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2305&root=pulseaudio&view=rev
Log:
respect the resampler's maximum block size to avoid that we get kicked out of the memory pool due to resampling. actually drop data from the delay queue after we used it

Modified:
    branches/glitch-free/src/pulsecore/source-output.c

Modified: branches/glitch-free/src/pulsecore/source-output.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/pulsecore/source-output.c?rev=2305&root=pulseaudio&r1=2304&r2=2305&view=diff
==============================================================================
--- branches/glitch-free/src/pulsecore/source-output.c (original)
+++ branches/glitch-free/src/pulsecore/source-output.c Wed Apr 23 20:14:25 2008
@@ -359,7 +359,7 @@
 /* Called from thread context */
 void pa_source_output_push(pa_source_output *o, const pa_memchunk *chunk) {
     size_t length;
-    size_t limit;
+    size_t limit, mbs = 0;
 
     pa_source_output_assert_ref(o);
     pa_assert(PA_SOURCE_OUTPUT_LINKED(o->thread_info.state));
@@ -396,6 +396,12 @@
         else {
             pa_memchunk rchunk;
 
+            if (mbs == 0)
+                mbs = pa_resampler_max_block_size(o->thread_info.resampler);
+
+            if (qchunk.length > mbs)
+                qchunk.length = mbs;
+
             pa_resampler_run(o->thread_info.resampler, &qchunk, &rchunk);
 
             if (rchunk.length > 0)
@@ -405,6 +411,7 @@
         }
 
         pa_memblock_unref(qchunk.memblock);
+        pa_memblockq_drop(o->thread_info.delay_memblockq, qchunk.length);
     }
 }
 




More information about the pulseaudio-commits mailing list