Commit 9bea9fd3 authored by David Reid's avatar David Reid

Have ma_sound_init_from_file() return error when no file path is given.

parent 05591883
...@@ -73669,21 +73669,35 @@ done: ...@@ -73669,21 +73669,35 @@ done:
MA_API ma_result ma_sound_init_from_file(ma_engine* pEngine, const char* pFilePath, ma_uint32 flags, ma_sound_group* pGroup, ma_fence* pDoneFence, ma_sound* pSound) MA_API ma_result ma_sound_init_from_file(ma_engine* pEngine, const char* pFilePath, ma_uint32 flags, ma_sound_group* pGroup, ma_fence* pDoneFence, ma_sound* pSound)
{ {
ma_sound_config config = ma_sound_config_init_2(pEngine); ma_sound_config config;
if (pFilePath == NULL) {
return MA_INVALID_ARGS;
}
config = ma_sound_config_init_2(pEngine);
config.pFilePath = pFilePath; config.pFilePath = pFilePath;
config.flags = flags; config.flags = flags;
config.pInitialAttachment = pGroup; config.pInitialAttachment = pGroup;
config.pDoneFence = pDoneFence; config.pDoneFence = pDoneFence;
return ma_sound_init_ex(pEngine, &config, pSound); return ma_sound_init_ex(pEngine, &config, pSound);
} }
MA_API ma_result ma_sound_init_from_file_w(ma_engine* pEngine, const wchar_t* pFilePath, ma_uint32 flags, ma_sound_group* pGroup, ma_fence* pDoneFence, ma_sound* pSound) MA_API ma_result ma_sound_init_from_file_w(ma_engine* pEngine, const wchar_t* pFilePath, ma_uint32 flags, ma_sound_group* pGroup, ma_fence* pDoneFence, ma_sound* pSound)
{ {
ma_sound_config config = ma_sound_config_init_2(pEngine); ma_sound_config config;
if (pFilePath == NULL) {
return MA_INVALID_ARGS;
}
config = ma_sound_config_init_2(pEngine);
config.pFilePathW = pFilePath; config.pFilePathW = pFilePath;
config.flags = flags; config.flags = flags;
config.pInitialAttachment = pGroup; config.pInitialAttachment = pGroup;
config.pDoneFence = pDoneFence; config.pDoneFence = pDoneFence;
return ma_sound_init_ex(pEngine, &config, pSound); return ma_sound_init_ex(pEngine, &config, pSound);
} }
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