volume work

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@42 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2004-06-29 20:37:24 +00:00
parent e31bac0257
commit d571be6f51
12 changed files with 203 additions and 35 deletions

View file

@ -78,3 +78,17 @@ void memblock_unref_fixed(struct memblock *b) {
b->type = MEMBLOCK_DYNAMIC;
}
void memchunk_make_writable(struct memchunk *c) {
struct memblock *n;
assert(c && c->memblock && c->memblock->ref >= 1);
if (c->memblock->ref == 1)
return;
n = memblock_new(c->length);
assert(n);
memcpy(n->data, c->memblock->data+c->index, c->length);
memblock_unref(c->memblock);
c->memblock = n;
c->index = 0;
}