You need to sign in or sign up before continuing.
Commit 369fb6fd authored by David Reid's avatar David Reid

Some small improvements to the resource manager.

These changes are in preparation for fixing some issues relating to
retrieval of channel counts from data sources. The problem relates to
the asynchronous nature of the resource manager and how data sources
may be in the middle of loading when trying to initialize a sound which
results in the channel count not yet being available. The channel count
is necessary in order for the engine to be able to convert the data
source to the channel count of the final output.
parent 085728fd
...@@ -18,13 +18,6 @@ void on_sound_loaded(ma_async_notification* pNotification, int code) ...@@ -18,13 +18,6 @@ void on_sound_loaded(ma_async_notification* pNotification, int code)
//ma_uint64 lengthInPCMFrames; //ma_uint64 lengthInPCMFrames;
(void)pNotification; (void)pNotification;
if (code == MA_NOTIFICATION_INIT) {
} else if (code == MA_NOTIFICATION_COMPLETE) {
}
(void)code; (void)code;
/* /*
...@@ -85,7 +78,7 @@ int main(int argc, char** argv) ...@@ -85,7 +78,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_DATA_SOURCE_FLAG_DECODE /*| MA_DATA_SOURCE_FLAG_ASYNC | MA_DATA_SOURCE_FLAG_STREAM*/, &loadNotification, NULL, &sound); result = ma_sound_init_from_file(&engine, argv[1], MA_DATA_SOURCE_FLAG_DECODE | MA_DATA_SOURCE_FLAG_ASYNC /*| MA_DATA_SOURCE_FLAG_STREAM*/, &loadNotification, 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);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment