diff options
Diffstat (limited to 'extern/audaspace/bindings/C/AUD_Sound.cpp')
-rw-r--r-- | extern/audaspace/bindings/C/AUD_Sound.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/extern/audaspace/bindings/C/AUD_Sound.cpp b/extern/audaspace/bindings/C/AUD_Sound.cpp index aa246b9a047..8a3c9d1bbc9 100644 --- a/extern/audaspace/bindings/C/AUD_Sound.cpp +++ b/extern/audaspace/bindings/C/AUD_Sound.cpp @@ -102,26 +102,30 @@ AUD_API int AUD_Sound_getFileStreams(AUD_Sound* sound, AUD_StreamInfo **stream_i if(file) { - auto streams = file->queryStreams(); + try + { + auto streams = file->queryStreams(); - size_t size = sizeof(AUD_StreamInfo) * streams.size(); + size_t size = sizeof(AUD_StreamInfo) * streams.size(); - if(!size) - { - *stream_infos = nullptr; - return 0; - } + if(!size) + { + *stream_infos = nullptr; + return 0; + } - *stream_infos = reinterpret_cast<AUD_StreamInfo*>(std::malloc(size)); - std::memcpy(*stream_infos, streams.data(), size); + *stream_infos = reinterpret_cast<AUD_StreamInfo*>(std::malloc(size)); + std::memcpy(*stream_infos, streams.data(), size); - return streams.size(); - } - else - { - *stream_infos = nullptr; - return 0; + return streams.size(); + } + catch(Exception&) + { + } } + + *stream_infos = nullptr; + return 0; } AUD_API sample_t* AUD_Sound_data(AUD_Sound* sound, int* length, AUD_Specs* specs) |