memblock: Add pa_memblock_acquire_chunk().

Besides making the code a bit cleaner, this also gets rid of
a few "cast increases required alignment of target type"
warnings.
This commit is contained in:
Tanu Kaskinen 2012-08-17 18:09:34 +03:00 committed by Tanu Kaskinen
parent 33e5802df2
commit 3d6092bb0f
16 changed files with 52 additions and 40 deletions

View file

@ -575,7 +575,7 @@ static void process_samples(struct userdata *u){
static void input_buffer(struct userdata *u, pa_memchunk *in){
size_t fs = pa_frame_size(&(u->sink->sample_spec));
size_t samples = in->length/fs;
float *src = (float*) ((uint8_t*) pa_memblock_acquire(in->memblock) + in->index);
float *src = pa_memblock_acquire_chunk(in);
pa_assert(u->samples_gathered + samples <= u->input_buffer_max);
for(size_t c = 0; c < u->channels; c++) {
//buffer with an offset after the overlap from previous