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. --HG-- extra : rebase_source : c803b416ec487b8c0feba780ac06f8d11e90879b
This commit is contained in:
parent
f8d3d73cc9
commit
c40d568133
2 changed files with 9 additions and 9 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue