try to keep API boundaries passing frames, instead of bytes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user