Add ma_audio_buffer_ref.

This is a data source whose backing data is an application-controlled
pointer. No data is copied. It's a way of efficiently wrapping a raw
buffer and using it as a data source.
This commit is contained in:
David Reid
2021-01-16 17:51:50 +10:00
parent aeb51a8eeb
commit d3d98ee3a2
2 changed files with 289 additions and 169 deletions
+1 -1
View File
@@ -5531,7 +5531,7 @@ static ma_result ma_resource_manager_data_buffer_init_connector(ma_resource_mana
config = ma_audio_buffer_config_init(pDataBuffer->pNode->data.decoded.format, pDataBuffer->pNode->data.decoded.channels, pDataBuffer->pNode->data.decoded.frameCount, pDataBuffer->pNode->data.encoded.pData, NULL);
result = ma_audio_buffer_init(&config, &pDataBuffer->connector.buffer);
pDataBuffer->lengthInPCMFrames = pDataBuffer->connector.buffer.sizeInFrames;
pDataBuffer->lengthInPCMFrames = pDataBuffer->connector.buffer.ref.sizeInFrames;
} else {
ma_decoder_config configOut;
configOut = ma_decoder_config_init(pDataBuffer->pResourceManager->config.decodedFormat, pDataBuffer->pResourceManager->config.decodedChannels, pDataBuffer->pResourceManager->config.decodedSampleRate);