Fix crash.
This commit is contained in:
@@ -28,14 +28,10 @@ const unsigned freq = 44100;
|
|||||||
const unsigned buffersize = samples * samplesize;
|
const unsigned buffersize = samples * samplesize;
|
||||||
const unsigned initialSounds = 10;
|
const unsigned initialSounds = 10;
|
||||||
|
|
||||||
#if defined(DEBUG)
|
|
||||||
#define TEST_ERR(err, func) \
|
#define TEST_ERR(err, func) \
|
||||||
CHECKPOINT; \
|
CHECKPOINT; \
|
||||||
if (__builtin_expect(err, noErr)) \
|
if (__builtin_expect(err, noErr)) \
|
||||||
RageException::Throw(#func " failed with error: %d at %s:%d", err, __FILE__, __LINE__)
|
RageException::Throw(#func " failed with error: %d at %s:%d", err, __FILE__, __LINE__)
|
||||||
#else
|
|
||||||
#define TEST_ERR(err, func) CHECKPOINT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct soundInfo
|
typedef struct soundInfo
|
||||||
{
|
{
|
||||||
@@ -329,6 +325,8 @@ static void CallBack(QTCallBack cb, long refCon)
|
|||||||
if (!cb)
|
if (!cb)
|
||||||
{
|
{
|
||||||
StartMovie(movie);
|
StartMovie(movie);
|
||||||
|
err = GetMoviesError();
|
||||||
|
TEST_ERR(err, StartMovie);
|
||||||
cb = NewCallBack(GetMovieTimeBase(movie), callBackAtTime);
|
cb = NewCallBack(GetMovieTimeBase(movie), callBackAtTime);
|
||||||
timeToCall = halfsamples;
|
timeToCall = halfsamples;
|
||||||
}
|
}
|
||||||
@@ -359,6 +357,7 @@ RageSound_QT::RageSound_QT()
|
|||||||
err = GetMoviesError();
|
err = GetMoviesError();
|
||||||
TEST_ERR(err, NewMovieTrack);
|
TEST_ERR(err, NewMovieTrack);
|
||||||
|
|
||||||
|
sndDescHdl = (SoundDescriptionHandle)NewHandleClear(sizeof(SoundDescription));
|
||||||
HLock(Handle(sndDescHdl));
|
HLock(Handle(sndDescHdl));
|
||||||
err = MemError();
|
err = MemError();
|
||||||
TEST_ERR(err, HLock);
|
TEST_ERR(err, HLock);
|
||||||
|
|||||||
Reference in New Issue
Block a user