mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-11 17:05:41 +00:00
audio: don't cast to double in SDL_ConvertStereoToMono().
It's expensive and (hopefully) unnecessary. If this becomes an overflow problem, we could multiply both values by 0.5f before adding them, but let's see if we can get by without the extra multiplication first.
This commit is contained in:
parent
83454c821f
commit
a7f86f2fd2
1 changed files with 1 additions and 1 deletions
|
|
@ -41,7 +41,7 @@ SDL_ConvertStereoToMono(SDL_AudioCVT * cvt, SDL_AudioFormat format)
|
|||
SDL_assert(format == AUDIO_F32SYS);
|
||||
|
||||
for (i = cvt->len_cvt / 8; i; --i, src += 2) {
|
||||
*(dst++) = (float) ((((double) src[0]) + ((double) src[1])) * 0.5);
|
||||
*(dst++) = (src[0] + src[1]) * 0.5f;
|
||||
}
|
||||
|
||||
cvt->len_cvt /= 2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue