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 /Alc/backends/oss.cpp | |
parent | 4f253a935a14e49a77516a56e0d4c6d6177a56b6 (diff) |
Clean up the ring buffer struct and use member functions
Diffstat (limited to 'Alc/backends/oss.cpp')
-rw-r--r-- | Alc/backends/oss.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Alc/backends/oss.cpp b/Alc/backends/oss.cpp index e338c40d..f6a75d12 100644 --- a/Alc/backends/oss.cpp +++ b/Alc/backends/oss.cpp @@ -537,7 +537,8 @@ void ALCcaptureOSS_Destruct(ALCcaptureOSS *self) int ALCcaptureOSS_recordProc(ALCcaptureOSS *self) { - ALCdevice *device{STATIC_CAST(ALCbackend, self)->mDevice}; + ALCdevice *device{self->mDevice}; + RingBuffer *ring{self->mRing.get()}; SetRTPriority(); althrd_setname(RECORD_THREAD_NAME); @@ -564,7 +565,7 @@ int ALCcaptureOSS_recordProc(ALCcaptureOSS *self) continue; } - auto vec = ll_ringbuffer_get_write_vector(self->mRing.get()); + auto vec = ring->getWriteVector(); if(vec.first.len > 0) { ssize_t amt{read(self->fd, vec.first.buf, vec.first.len*frame_size)}; @@ -576,7 +577,7 @@ int ALCcaptureOSS_recordProc(ALCcaptureOSS *self) ALCcaptureOSS_unlock(self); break; } - ll_ringbuffer_write_advance(self->mRing.get(), amt/frame_size); + ring->writeAdvance(amt/frame_size); } } @@ -724,13 +725,15 @@ void ALCcaptureOSS_stop(ALCcaptureOSS *self) ALCenum ALCcaptureOSS_captureSamples(ALCcaptureOSS *self, ALCvoid *buffer, ALCuint samples) { - ll_ringbuffer_read(self->mRing.get(), static_cast<char*>(buffer), samples); + RingBuffer *ring{self->mRing.get()}; + ring->read(buffer, samples); return ALC_NO_ERROR; } ALCuint ALCcaptureOSS_availableSamples(ALCcaptureOSS *self) { - return ll_ringbuffer_read_space(self->mRing.get()); + RingBuffer *ring{self->mRing.get()}; + return ring->readSpace(); } } // namespace |