Update OpenAL-Soft to 1.22.0

This commit is contained in:
Alex Szpakowski
2022-04-30 21:02:11 -03:00
parent 4f72a5e5d9
commit 2b15394df5
229 changed files with 30602 additions and 7654 deletions
+11 -9
View File
@@ -16,13 +16,6 @@
* single-consumer/single-provider operation.
*/
struct ll_ringbuffer_data {
al::byte *buf;
size_t len;
};
using ll_ringbuffer_data_pair = std::pair<ll_ringbuffer_data,ll_ringbuffer_data>;
struct RingBuffer {
private:
std::atomic<size_t> mWritePtr{0u};
@@ -34,6 +27,13 @@ private:
al::FlexArray<al::byte, 16> mBuffer;
public:
struct Data {
al::byte *buf;
size_t len;
};
using DataPair = std::pair<Data,Data>;
RingBuffer(const size_t count) : mBuffer{count} { }
/** Reset the read and write pointers to zero. This is not thread safe. */
@@ -44,13 +44,13 @@ public:
* hold the current readable data. If the readable data is in one segment
* the second segment has zero length.
*/
ll_ringbuffer_data_pair getReadVector() const noexcept;
DataPair getReadVector() const noexcept;
/**
* The non-copying data writer. Returns two ringbuffer data pointers that
* hold the current writeable data. If the writeable data is in one segment
* the second segment has zero length.
*/
ll_ringbuffer_data_pair getWriteVector() const noexcept;
DataPair getWriteVector() const noexcept;
/**
* Return the number of elements available for reading. This is the number
@@ -98,6 +98,8 @@ public:
void writeAdvance(size_t cnt) noexcept
{ mWritePtr.fetch_add(cnt, std::memory_order_acq_rel); }
size_t getElemSize() const noexcept { return mElemSize; }
/**
* Create a new ringbuffer to hold at least `sz' elements of `elem_sz'
* bytes. The number of elements is rounded up to the next power of two