diff options
author | Chris Robinson <[email protected]> | 2023-03-07 13:30:15 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-03-07 13:30:15 -0800 |
commit | ed6b8230bd1f4ac502ce4915d24fedacf3eceee0 (patch) | |
tree | c7766a230fc26a2322ebd472a8022286f544545b /alc | |
parent | f11313c62dd6ab8666023e90dc6fbf3fc70cb1da (diff) |
Add queries for the buffer byte/sample/sec length
These used to exist with the now-defunct AL_SOFT_buffer_samples extension, this
just restores those queries without extra baggage.
The sample length query are necessary when handling ADPCM buffers, since the
size/channels*8/bits calculation is incorrect with ADPCM. 'Bits' is usually
reported as 4 since most samples in a block are stored as nibbles, but that's
only approximate and doesn't account for the block header. The average number
of bits per sample in an ADPCM block can't be represented as an integer, so the
more blocks there are stored in the buffer, the more inaccurate the calculation
becomes.
Diffstat (limited to 'alc')
-rw-r--r-- | alc/context.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/alc/context.cpp b/alc/context.cpp index 288f5965..cff666e8 100644 --- a/alc/context.cpp +++ b/alc/context.cpp @@ -62,6 +62,7 @@ constexpr ALchar alExtList[] = "AL_SOFT_bformat_ex " "AL_SOFTX_bformat_hoa " "AL_SOFT_block_alignment " + "AL_SOFT_buffer_length_query " "AL_SOFT_callback_buffer " "AL_SOFTX_convolution_reverb " "AL_SOFT_deferred_updates " |