mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 16:54:03 +02:00
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.
This commit is contained in:
@@ -18,13 +18,6 @@ void on_sound_loaded(ma_async_notification* pNotification, int code)
|
||||
//ma_uint64 lengthInPCMFrames;
|
||||
|
||||
(void)pNotification;
|
||||
|
||||
if (code == MA_NOTIFICATION_INIT) {
|
||||
|
||||
} else if (code == MA_NOTIFICATION_COMPLETE) {
|
||||
|
||||
}
|
||||
|
||||
(void)code;
|
||||
|
||||
/*
|
||||
@@ -85,7 +78,7 @@ int main(int argc, char** argv)
|
||||
loadNotification.cb.onSignal = on_sound_loaded;
|
||||
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) {
|
||||
printf("Failed to load sound: %s\n", argv[1]);
|
||||
ma_engine_uninit(&engine);
|
||||
|
||||
Reference in New Issue
Block a user