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:
Ryan C. Gordon
2017-01-15 05:01:59 -05:00
parent 1e4820951f
commit 1e66d457d7
2 changed files with 9 additions and 9 deletions

View File

@@ -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));
}