From b2cb83598c717fb0a23a20b72c989e88aa5e8dfa Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Mon, 16 Aug 2010 13:13:05 +0000 Subject: [PATCH] Audaspace: * Fix for uncached exception whith invalid audio file. * Includes fix for windows. --- intern/audaspace/Python/AUD_PyAPI.cpp | 3 --- intern/audaspace/intern/AUD_C-API.cpp | 21 ++++++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/intern/audaspace/Python/AUD_PyAPI.cpp b/intern/audaspace/Python/AUD_PyAPI.cpp index 4b1298b04a4..b0c55d5856e 100644 --- a/intern/audaspace/Python/AUD_PyAPI.cpp +++ b/intern/audaspace/Python/AUD_PyAPI.cpp @@ -58,9 +58,6 @@ #include "AUD_JackDevice.h" #endif -#include -#include - // ==================================================================== typedef enum diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp index 40cbbd92d93..a12478ab477 100644 --- a/intern/audaspace/intern/AUD_C-API.cpp +++ b/intern/audaspace/intern/AUD_C-API.cpp @@ -244,20 +244,23 @@ AUD_SoundInfo AUD_getInfo(AUD_Sound* sound) { assert(sound); - AUD_IReader* reader = sound->createReader(); - AUD_SoundInfo info; + info.specs.channels = AUD_CHANNELS_INVALID; + info.specs.rate = AUD_RATE_INVALID; + info.length = 0.0f; - if(reader) + try { - info.specs = reader->getSpecs(); - info.length = reader->getLength() / (float) info.specs.rate; + AUD_IReader* reader = sound->createReader(); + + if(reader) + { + info.specs = reader->getSpecs(); + info.length = reader->getLength() / (float) info.specs.rate; + } } - else + catch(AUD_Exception&) { - info.specs.channels = AUD_CHANNELS_INVALID; - info.specs.rate = AUD_RATE_INVALID; - info.length = 0.0f; } return info; -- 2.28.0