diff options
author | Chris Robinson <[email protected]> | 2018-12-26 21:22:17 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-26 21:22:17 -0800 |
commit | 8a0295503db394ea895bfa079d1f3eda0d758e61 (patch) | |
tree | 21a1a1e63fe148dc087ad2c35ce94a49418ef900 /OpenAL32/alSource.cpp | |
parent | 4f253a935a14e49a77516a56e0d4c6d6177a56b6 (diff) |
Clean up the ring buffer struct and use member functions
Diffstat (limited to 'OpenAL32/alSource.cpp')
-rw-r--r-- | OpenAL32/alSource.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/OpenAL32/alSource.cpp b/OpenAL32/alSource.cpp index b70fc872..03375e2d 100644 --- a/OpenAL32/alSource.cpp +++ b/OpenAL32/alSource.cpp @@ -691,13 +691,14 @@ void SendStateChangeEvent(ALCcontext *context, ALuint id, ALenum state) * and we don't want state change messages to occur out of order, so send * it through the async queue to ensure proper ordering. */ - auto evt_data = ll_ringbuffer_get_write_vector(context->AsyncEvents).first; - if(evt_data.len < 1) return; + RingBuffer *ring{context->AsyncEvents}; + auto evt_vec = ring->getWriteVector(); + if(evt_vec.first.len < 1) return; - AsyncEvent *evt{new (evt_data.buf) AsyncEvent{EventType_SourceStateChange}}; + AsyncEvent *evt{new (evt_vec.first.buf) AsyncEvent{EventType_SourceStateChange}}; evt->u.srcstate.id = id; evt->u.srcstate.state = state; - ll_ringbuffer_write_advance(context->AsyncEvents, 1); + ring->writeAdvance(1); context->EventSem.post(); } |