mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 08:44:04 +02:00
Have ma_sound_init_from_file() return error when no file path is given.
This commit is contained in:
+16
-2
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user