[pulseaudio-commits] r2526 - /trunk/src/pulsecore/memchunk.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Fri Jun 13 14:55:03 PDT 2008
Author: lennart
Date: Fri Jun 13 23:55:01 2008
New Revision: 2526
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2526&root=pulseaudio&view=rev
Log:
rearrange things
Modified:
trunk/src/pulsecore/memchunk.c
Modified: trunk/src/pulsecore/memchunk.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/memchunk.c?rev=2526&root=pulseaudio&r1=2525&r2=2526&view=diff
==============================================================================
--- trunk/src/pulsecore/memchunk.c (original)
+++ trunk/src/pulsecore/memchunk.c Fri Jun 13 23:55:01 2008
@@ -49,17 +49,20 @@
pa_memblock_get_length(c->memblock) >= c->index+min)
return c;
- l = c->length;
- if (l < min)
- l = min;
+ l = PA_MAX(c->length, min);
n = pa_memblock_new(pa_memblock_get_pool(c->memblock), l);
+
+ sdata = pa_memblock_acquire(c->memblock);
tdata = pa_memblock_acquire(n);
- sdata = pa_memblock_acquire(c->memblock);
+
memcpy(tdata, (uint8_t*) sdata + c->index, c->length);
+
+ pa_memblock_release(c->memblock);
pa_memblock_release(n);
- pa_memblock_release(c->memblock);
+
pa_memblock_unref(c->memblock);
+
c->memblock = n;
c->index = 0;
More information about the pulseaudio-commits
mailing list