[pulseaudio-commits] r2271 - in /branches/glitch-free/src/pulsecore: memchunk.c memchunk.h

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sun Apr 20 12:40:30 PDT 2008


Author: lennart
Date: Sun Apr 20 21:40:30 2008
New Revision: 2271

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2271&root=pulseaudio&view=rev
Log:
add new API function pa_memchunk_memcpy()

Modified:
    branches/glitch-free/src/pulsecore/memchunk.c
    branches/glitch-free/src/pulsecore/memchunk.h

Modified: branches/glitch-free/src/pulsecore/memchunk.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/pulsecore/memchunk.c?rev=2271&root=pulseaudio&r1=2270&r2=2271&view=diff
==============================================================================
--- branches/glitch-free/src/pulsecore/memchunk.c (original)
+++ branches/glitch-free/src/pulsecore/memchunk.c Sun Apr 20 21:40:30 2008
@@ -90,3 +90,23 @@
 
     return (pa_memchunk*) c;
 }
+
+pa_memchunk* pa_memchunk_memcpy(pa_memchunk *dst, pa_memchunk *src) {
+    void *p, *q;
+
+    pa_assert(dst);
+    pa_assert(src);
+    pa_assert(dst->length == src->length);
+
+    p = pa_memblock_acquire(dst->memblock);
+    q = pa_memblock_acquire(src->memblock);
+
+    memmove((uint8_t*) p + dst->index,
+            (uint8_t*) q + src->index,
+            dst->length);
+
+    pa_memblock_release(dst->memblock);
+    pa_memblock_release(src->memblock);
+
+    return dst;
+}

Modified: branches/glitch-free/src/pulsecore/memchunk.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/pulsecore/memchunk.h?rev=2271&root=pulseaudio&r1=2270&r2=2271&view=diff
==============================================================================
--- branches/glitch-free/src/pulsecore/memchunk.h (original)
+++ branches/glitch-free/src/pulsecore/memchunk.h Sun Apr 20 21:40:30 2008
@@ -49,4 +49,7 @@
 /* Map a memory chunk back into memory if it was swapped out */
 pa_memchunk *pa_memchunk_will_need(const pa_memchunk *c);
 
+/* Copy the data in the src memchunk to the dst memchunk */
+pa_memchunk* pa_memchunk_memcpy(pa_memchunk *dst, pa_memchunk *src);
+
 #endif




More information about the pulseaudio-commits mailing list