Fix off by one crash. I meant to commit this days ago.

This commit is contained in:
Steve Checkoway
2004-07-09 00:49:26 +00:00
parent ea8833bf1c
commit e1163df683
@@ -183,7 +183,7 @@ RageSound_CA::RageSound_CA()
const Desc& procFormat = FindClosestFormat( procFormats, mFormat ); const Desc& procFormat = FindClosestFormat( procFormats, mFormat );
stream.SetCurrentIOProcFormat( procFormat ); stream.SetCurrentIOProcFormat( procFormat );
//mFormat = OTHER; // XXX Temporary
LOG->Info("Proc format is %s.", LOG->Info("Proc format is %s.",
mFormat == EXACT ? "exact" : (mFormat == CANONICAL ? mFormat == EXACT ? "exact" : (mFormat == CANONICAL ?
"canonical" : "other")); "canonical" : "other"));
@@ -309,9 +309,9 @@ OSStatus RageSound_CA::GetData(AudioDeviceID inDevice,
// Convert from signed 16 bit int to signed 32 bit float // Convert from signed 16 bit int to signed 32 bit float
for (unsigned i = 0; i < buf.mDataByteSize; i += 4) for (unsigned i = 0; i < buf.mDataByteSize; i += 4)
{ {
int16_t val = *(++ip); int16_t val = *(ip++);
*(++fp) = val / (val < 0 ? 32768.0f : 32767.0f); *(fp++) = val / (val < 0 ? 32768.0f : 32767.0f);
} }
} }