Audaspace:

* Fix for uncached exception whith invalid audio file.
* Includes fix for windows.
This commit is contained in:
Joerg Mueller
2010-08-16 13:13:05 +00:00
parent 77e286fee9
commit b2cb83598c
2 changed files with 12 additions and 12 deletions

View File

@@ -58,9 +58,6 @@
#include "AUD_JackDevice.h"
#endif
#include <cstdlib>
#include <unistd.h>
// ====================================================================
typedef enum

View File

@@ -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;