ringbuffer: simplify the API

Use absolute indexes that we let wrap around. We can then easily detect
how much we under of overflowed by using serial number arithmetic.
Remove the Areas, we can trivially compute this ourselves, move the
logic in read/write_data.
This commit is contained in:
Wim Taymans 2017-04-20 11:25:24 +02:00
parent 90ea120d3c
commit 0b508db9fc
6 changed files with 107 additions and 138 deletions

View file

@ -576,17 +576,6 @@ spa_audiomixer_node_port_send_command (SpaNode *node,
return SPA_RESULT_NOT_IMPLEMENTED;
}
static void
clear_buffer (SpaAudioMixer *this, MixerBuffer *out)
{
int16_t *op;
size_t os;
op = SPA_MEMBER (out->outbuf->datas[0].data, out->outbuf->datas[0].chunk->offset, void);
os = out->outbuf->datas[0].chunk->size;
memset (op, 0, os);
}
static void
add_port_data (SpaAudioMixer *this, MixerBuffer *out, SpaAudioMixerPort *port, int layer)
{