From ed6b8230bd1f4ac502ce4915d24fedacf3eceee0 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 7 Mar 2023 13:30:15 -0800 Subject: 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. --- alc/context.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'alc/context.cpp') 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 " -- cgit v1.2.3