mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-21 15:56:58 +02:00
Fix a bug introduced with a recent commit.
This commit is contained in:
@@ -58945,6 +58945,7 @@ static ma_result ma_resource_manager_data_buffer_node_acquire(ma_resource_manage
|
|||||||
|
|
||||||
if (result == MA_ALREADY_EXISTS) {
|
if (result == MA_ALREADY_EXISTS) {
|
||||||
nodeAlreadyExists = MA_TRUE;
|
nodeAlreadyExists = MA_TRUE;
|
||||||
|
result = MA_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ int main(int argc, char** argv)
|
|||||||
//resourceManagerConfig.decodedChannels = 2;
|
//resourceManagerConfig.decodedChannels = 2;
|
||||||
resourceManagerConfig.decodedSampleRate = 48000;
|
resourceManagerConfig.decodedSampleRate = 48000;
|
||||||
//resourceManagerConfig.flags |= MA_RESOURCE_MANAGER_FLAG_NO_THREADING;
|
//resourceManagerConfig.flags |= MA_RESOURCE_MANAGER_FLAG_NO_THREADING;
|
||||||
resourceManagerConfig.jobThreadCount = 1;
|
resourceManagerConfig.jobThreadCount = 16;
|
||||||
|
resourceManagerConfig.jobQueueCapacity = 8;
|
||||||
result = ma_resource_manager_init(&resourceManagerConfig, &resourceManager);
|
result = ma_resource_manager_init(&resourceManagerConfig, &resourceManager);
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
printf("Failed to initialize resource manager.\n");
|
printf("Failed to initialize resource manager.\n");
|
||||||
@@ -79,7 +80,7 @@ int main(int argc, char** argv)
|
|||||||
loadNotification.cb.onSignal = on_sound_loaded;
|
loadNotification.cb.onSignal = on_sound_loaded;
|
||||||
loadNotification.pSound = &sound;
|
loadNotification.pSound = &sound;
|
||||||
|
|
||||||
result = ma_sound_init_from_file(&engine, argv[1], MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_DECODE | MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_ASYNC | MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_STREAM, &group, NULL, &sound);
|
result = ma_sound_init_from_file(&engine, argv[1], MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_DECODE | MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_ASYNC /*| MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_STREAM*/, &group, NULL, &sound);
|
||||||
if (result != MA_SUCCESS) {
|
if (result != MA_SUCCESS) {
|
||||||
printf("Failed to load sound: %s\n", argv[1]);
|
printf("Failed to load sound: %s\n", argv[1]);
|
||||||
ma_engine_uninit(&engine);
|
ma_engine_uninit(&engine);
|
||||||
|
|||||||
Reference in New Issue
Block a user