MA_APIma_resultma_resource_manager_register_decoded_data(ma_resource_manager*pResourceManager,constchar*pName,constvoid*pData,ma_uint64frameCount,ma_formatformat,ma_uint32channels,ma_uint32sampleRate);/* Does not copy. Increments the reference count if already exists and returns MA_SUCCESS. */
MA_APIma_resultma_resource_manager_register_decoded_data(ma_resource_manager*pResourceManager,constchar*pName,constvoid*pData,ma_uint64frameCount,ma_formatformat,ma_uint32channels,ma_uint32sampleRate);/* Does not copy. Increments the reference count if already exists and returns MA_SUCCESS. */
MA_APIma_resultma_resource_manager_register_encoded_data(ma_resource_manager*pResourceManager,constchar*pName,constvoid*pData,size_tsizeInBytes);/* Does not copy. Increments the reference count if already exists and returns MA_SUCCESS. */
MA_APIma_resultma_resource_manager_register_encoded_data(ma_resource_manager*pResourceManager,constchar*pName,constvoid*pData,size_tsizeInBytes);/* Does not copy. Increments the reference count if already exists and returns MA_SUCCESS. */
ma_uint32refCount;/* The new reference count of the node after decrementing. */
ma_uint32refCount=0xFFFFFFFF;/* The new reference count of the node after decrementing. Initialize to non-0 to be safe we don't fall into the freeing path. */
returnresult;/* Should never happen. Failed to increment the reference count. */
}
}else{
/* Slow path. The data for this buffer has not yet been initialized. The first thing to do is allocate the new data buffer and insert it into the BST. */
It's assumed that the data specified by pName was registered with a prior call to ma_resource_manager_register_encoded/decoded_data(). To unregister it, all
we need to do is delete the data buffer by it's name.