diff --git a/stepmania/src/arch/Sound/CAHelpers.cpp b/stepmania/src/arch/Sound/CAHelpers.cpp index 8322e9f313..61041f583d 100644 --- a/stepmania/src/arch/Sound/CAHelpers.cpp +++ b/stepmania/src/arch/Sound/CAHelpers.cpp @@ -40,7 +40,8 @@ OSStatus AudioConverter::FormatConverterInputProc(UInt32& ioNumberDataPackets, } buf.mData = mBuffer; - mDriver->FillConverter( buf.mData, buf.mDataByteSize ); + const int frames = buf.mDataByteSize / kBytesPerPacket; + mDriver->FillConverter( buf.mData, frames ); return noErr; } diff --git a/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp b/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp index c741c1dc80..c8aab195a4 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp @@ -239,10 +239,9 @@ int64_t RageSound_CA::GetPosition(const RageSoundBase *sound) const return int64_t(time.mSampleTime); } -void RageSound_CA::FillConverter(void *data, UInt32 dataByteSize) +void RageSound_CA::FillConverter( void *data, UInt32 frames ) { - int frames = dataByteSize / gConverter->GetInputFormat().mBytesPerPacket; - this->Mix((int16_t *)data, frames, mDecodePos, int64_t(mNow->mSampleTime)); + this->Mix( (int16_t *)data, frames, mDecodePos, int64_t(mNow->mSampleTime) ); } OSStatus RageSound_CA::GetData(AudioDeviceID inDevice, diff --git a/stepmania/src/arch/Sound/RageSoundDriver_CA.h b/stepmania/src/arch/Sound/RageSoundDriver_CA.h index 7cf002de9d..2b460e332c 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_CA.h +++ b/stepmania/src/arch/Sound/RageSoundDriver_CA.h @@ -35,7 +35,7 @@ private: void *inData); public: - void FillConverter(void *data, UInt32 dataByteSize); + void FillConverter( void *data, UInt32 frames ); RageSound_CA(); ~RageSound_CA(); float GetPlayLatency() const { return mLatency; }