mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Rename some config variables.
This commit is contained in:
@@ -223,7 +223,7 @@ int main(int argc, char** argv)
|
||||
decoderConfig = ma_decoder_config_init_default();
|
||||
decoderConfig.pCustomBackendUserData = NULL; /* In this example our backend objects are contained within a ma_decoder_ex object to avoid a malloc. Our vtables need to know about this. */
|
||||
decoderConfig.ppCustomBackendVTables = pCustomBackendVTables;
|
||||
decoderConfig.customBackendVTableCount = sizeof(pCustomBackendVTables) / sizeof(pCustomBackendVTables[0]);
|
||||
decoderConfig.customBackendCount = sizeof(pCustomBackendVTables) / sizeof(pCustomBackendVTables[0]);
|
||||
|
||||
result = ma_decoder_init_file(argv[1], &decoderConfig, &decoder);
|
||||
if (result != MA_SUCCESS) {
|
||||
|
||||
+2
-2
@@ -6141,7 +6141,7 @@ typedef struct
|
||||
} resampling;
|
||||
ma_allocation_callbacks allocationCallbacks;
|
||||
ma_decoding_backend_vtable** ppCustomBackendVTables;
|
||||
ma_uint32 customBackendVTableCount;
|
||||
ma_uint32 customBackendCount;
|
||||
void* pCustomBackendUserData;
|
||||
} ma_decoder_config;
|
||||
|
||||
@@ -46698,7 +46698,7 @@ static ma_result ma_decoder_init_custom__internal(const ma_decoder_config* pConf
|
||||
backendConfig = ma_decoding_backend_config_init(pConfig->format);
|
||||
|
||||
/* The order each backend is listed is what defines the priority. */
|
||||
for (ivtable = 0; ivtable < pConfig->customBackendVTableCount; ivtable += 1) {
|
||||
for (ivtable = 0; ivtable < pConfig->customBackendCount; ivtable += 1) {
|
||||
const ma_decoding_backend_vtable* pVTable = pConfig->ppCustomBackendVTables[ivtable];
|
||||
if (pVTable != NULL && pVTable->onInit != NULL) {
|
||||
result = pVTable->onInit(pConfig->pCustomBackendUserData, ma_decoder_internal_on_read__custom, ma_decoder_internal_on_seek__custom, ma_decoder_internal_on_tell__custom, pDecoder, &backendConfig, &pDecoder->allocationCallbacks, &pBackend);
|
||||
|
||||
@@ -220,7 +220,7 @@ int main(int argc, char** argv)
|
||||
/* Using custom decoding backends requires a resource manager. */
|
||||
resourceManagerConfig = ma_resource_manager_config_init();
|
||||
resourceManagerConfig.ppCustomDecodingBackendVTables = pCustomBackendVTables;
|
||||
resourceManagerConfig.customDecodingBackendVTableCount = sizeof(pCustomBackendVTables) / sizeof(pCustomBackendVTables[0]);
|
||||
resourceManagerConfig.customDecodingBackendCount = sizeof(pCustomBackendVTables) / sizeof(pCustomBackendVTables[0]);
|
||||
resourceManagerConfig.pCustomDecodingBackendUserData = NULL; /* <-- This will be passed in to the pUserData parameter of each function in the decoding backend vtables. */
|
||||
|
||||
result = ma_resource_manager_init(&resourceManagerConfig, &resourceManager);
|
||||
|
||||
@@ -1467,7 +1467,7 @@ typedef struct
|
||||
ma_uint32 flags;
|
||||
ma_vfs* pVFS; /* Can be NULL in which case defaults will be used. */
|
||||
ma_decoding_backend_vtable** ppCustomDecodingBackendVTables;
|
||||
ma_uint32 customDecodingBackendVTableCount;
|
||||
ma_uint32 customDecodingBackendCount;
|
||||
void* pCustomDecodingBackendUserData;
|
||||
} ma_resource_manager_config;
|
||||
|
||||
@@ -6909,8 +6909,8 @@ MA_API ma_result ma_resource_manager_init(const ma_resource_manager_config* pCon
|
||||
|
||||
|
||||
/* Custom decoding backends. */
|
||||
if (pConfig->ppCustomDecodingBackendVTables != NULL && pConfig->customDecodingBackendVTableCount > 0) {
|
||||
size_t sizeInBytes = sizeof(*pResourceManager->config.ppCustomDecodingBackendVTables) * pConfig->customDecodingBackendVTableCount;
|
||||
if (pConfig->ppCustomDecodingBackendVTables != NULL && pConfig->customDecodingBackendCount > 0) {
|
||||
size_t sizeInBytes = sizeof(*pResourceManager->config.ppCustomDecodingBackendVTables) * pConfig->customDecodingBackendCount;
|
||||
|
||||
pResourceManager->config.ppCustomDecodingBackendVTables = (ma_decoding_backend_vtable**)ma_malloc(sizeInBytes, &pResourceManager->config.allocationCallbacks);
|
||||
if (pResourceManager->config.ppCustomDecodingBackendVTables == NULL) {
|
||||
@@ -6920,7 +6920,7 @@ MA_API ma_result ma_resource_manager_init(const ma_resource_manager_config* pCon
|
||||
|
||||
MA_COPY_MEMORY(pResourceManager->config.ppCustomDecodingBackendVTables, pConfig->ppCustomDecodingBackendVTables, sizeInBytes);
|
||||
|
||||
pResourceManager->config.customDecodingBackendVTableCount = pConfig->customDecodingBackendVTableCount;
|
||||
pResourceManager->config.customDecodingBackendCount = pConfig->customDecodingBackendCount;
|
||||
pResourceManager->config.pCustomDecodingBackendUserData = pConfig->pCustomDecodingBackendUserData;
|
||||
}
|
||||
|
||||
@@ -7007,7 +7007,7 @@ static ma_decoder_config ma_resource_manager__init_decoder_config(ma_resource_ma
|
||||
config = ma_decoder_config_init(pResourceManager->config.decodedFormat, pResourceManager->config.decodedChannels, pResourceManager->config.decodedSampleRate);
|
||||
config.allocationCallbacks = pResourceManager->config.allocationCallbacks;
|
||||
config.ppCustomBackendVTables = pResourceManager->config.ppCustomDecodingBackendVTables;
|
||||
config.customBackendVTableCount = pResourceManager->config.customDecodingBackendVTableCount;
|
||||
config.customBackendCount = pResourceManager->config.customDecodingBackendCount;
|
||||
config.pCustomBackendUserData = pResourceManager->config.pCustomDecodingBackendUserData;
|
||||
|
||||
return config;
|
||||
|
||||
Reference in New Issue
Block a user