mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-08 10:56:27 +00:00
audio: Some fixes to the audio data type converter code.
Removed some needless things ("len / sizeof (Uint8)"), and made sure the int32 -> float code uses doubles to avoid working with large integer values in a 32-bit float.
This commit is contained in:
@@ -196,7 +196,7 @@ SDL_ResampleAudioSimple(const int chans, const double rate_incr,
|
||||
float *last_sample, const float *inbuf,
|
||||
const int inbuflen, float *outbuf, const int outbuflen)
|
||||
{
|
||||
const int framelen = chans * sizeof(float);
|
||||
const int framelen = chans * sizeof (float);
|
||||
const int total = (inbuflen / framelen);
|
||||
const int finalpos = total - chans;
|
||||
const double src_incr = 1.0 / rate_incr;
|
||||
@@ -220,7 +220,7 @@ SDL_ResampleAudioSimple(const int chans, const double rate_incr,
|
||||
idx += src_incr;
|
||||
}
|
||||
|
||||
return (int)((dst - outbuf) * sizeof(float));
|
||||
return (int) ((dst - outbuf) * sizeof (float));
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user