diff options
author | Chris Robinson <[email protected]> | 2014-03-04 05:16:45 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-03-04 05:53:35 -0800 |
commit | f3a87d72b266640a706ddd3234aa4313b53cabce (patch) | |
tree | af906bac99467fc9407f4d94fbddc678ab3f80a1 /Alc | |
parent | b0a6b6427cfedc194fceee19ddbb7653fca813df (diff) |
Add an extension to alter the block alignment for buffer unpack/pack ops
This is for unpacking (reading, e.g. alBufferData) and packing (writing, e.g.
alGetBufferSamplesSOFT) operations. The alignments are specified in sample
frames, with 0 meaning the default (65 for IMA4, 1 otherwise). IMA4 alignment
must be a multiple of 8, plus 1 (e.g. alignment = n*8 + 1), otherwise an error
will occur during (un)packing. Chenging the block alignment does not affect
already-loaded sample data, only future unpack/pack operations... so for
example, this is perfectly valid:
// Load mono IMA4 data with a block alignment of 1024 bytes, or 2041 sample
// frames.
alBufferi(buffer, AL_UNPACK_BLOCK_ALIGNMENT_SOFT, 2041);
alBufferData(buffer, AL_FORMAT_MONO_IMA4, data, data_len, srate);
alBufferi(buffer, AL_UNPACK_BLOCK_ALIGNMENT_SOFT, 0);
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -523,6 +523,8 @@ static const ALCenums enumeration[] = { DECL(AL_BYTE_LENGTH_SOFT), DECL(AL_SAMPLE_LENGTH_SOFT), DECL(AL_SEC_LENGTH_SOFT), + DECL(AL_UNPACK_BLOCK_ALIGNMENT_SOFT), + DECL(AL_PACK_BLOCK_ALIGNMENT_SOFT), DECL(AL_UNUSED), DECL(AL_PENDING), @@ -706,9 +708,9 @@ static const ALchar alExtList[] = "AL_EXT_ALAW AL_EXT_DOUBLE AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 " "AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_MULAW " "AL_EXT_MULAW_MCFORMATS AL_EXT_OFFSET AL_EXT_source_distance_model " - "AL_LOKI_quadriphonic AL_SOFT_buffer_samples AL_SOFT_buffer_sub_data " - "AL_SOFT_deferred_updates AL_SOFT_direct_channels AL_SOFT_loop_points " - "AL_SOFT_source_latency"; + "AL_LOKI_quadriphonic AL_SOFTX_block_alignment AL_SOFT_buffer_samples " + "AL_SOFT_buffer_sub_data AL_SOFT_deferred_updates AL_SOFT_direct_channels " + "AL_SOFT_loop_points AL_SOFT_source_latency"; static volatile ALCenum LastNullDeviceError = ALC_NO_ERROR; |