diff options
author | Chris Robinson <[email protected]> | 2019-01-03 15:54:18 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-01-03 15:54:18 -0800 |
commit | 21a17620e37dce28295cbc43b692d7fe910efd67 (patch) | |
tree | 871494a574020ae6f638f1d7d018a83381646267 /Alc/ringbuffer.h | |
parent | 88c2f11dcf697c4bac43249e1e98b34637988dbc (diff) |
Fix the ringbuffer write limit
Previously it just limited the returned write space, irrespective of how much
had already been written. The buffer could still be filled up by doing multiple
writes. Now the size is limited by adjusting the read pointer by the real vs
limited difference when calculating the writable space.
Diffstat (limited to 'Alc/ringbuffer.h')
-rw-r--r-- | Alc/ringbuffer.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Alc/ringbuffer.h b/Alc/ringbuffer.h index 317995b0..311477c9 100644 --- a/Alc/ringbuffer.h +++ b/Alc/ringbuffer.h @@ -26,7 +26,7 @@ using ll_ringbuffer_data_pair = std::pair<ll_ringbuffer_data,ll_ringbuffer_data> struct RingBuffer { std::atomic<size_t> mWritePtr{0u}; std::atomic<size_t> mReadPtr{0u}; - size_t mSize{0u}; + size_t mWriteSize{0u}; size_t mSizeMask{0u}; size_t mElemSize{0u}; |