mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
volume work
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@42 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
e31bac0257
commit
d571be6f51
12 changed files with 203 additions and 35 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue