ringbuffer: use gcc atomic operations

Remove barrier, use GCC atomic operations for ringbuffer
This commit is contained in:
Wim Taymans 2017-04-24 13:18:57 +02:00
parent 02d4dc0efd
commit baada0a330
7 changed files with 32 additions and 92 deletions

View file

@ -372,7 +372,7 @@ pull_frames (SpaALSAState *state,
dst,
n_bytes);
spa_ringbuffer_read_advance (ringbuffer, n_bytes);
spa_ringbuffer_read_update (ringbuffer, index + n_bytes);
reuse = avail == n_bytes;
} else {
offs = SPA_MIN (d[0].chunk->offset + state->ready_offset, d[0].maxsize);

View file

@ -324,7 +324,7 @@ audiotestsrc_make_buffer (SpaAudioTestSrc *this)
} else {
this->render_func (this, SPA_MEMBER (b->outbuf->datas[0].data, offset, void), n_samples);
}
spa_ringbuffer_write_advance (&b->rb->ringbuffer, n_bytes);
spa_ringbuffer_write_update (&b->rb->ringbuffer, index + n_bytes);
} else {
n_samples = n_bytes / this->bpf;
this->render_func (this, b->outbuf->datas[0].data, n_samples);