src/audio/SDL_mixer.c
changeset 2013 0615fa58c0be
parent 1985 8055185ae4ed
child 2014 7abe37467fa5
     1.1 --- a/src/audio/SDL_mixer.c	Fri Sep 01 19:16:26 2006 +0000
     1.2 +++ b/src/audio/SDL_mixer.c	Fri Sep 01 19:17:05 2006 +0000
     1.3 @@ -261,17 +261,17 @@
     1.4          {
     1.5              const Uint32 *src32 = (Uint32 *) src;
     1.6              Uint32 *dst32 = (Uint32 *) dst;
     1.7 -            Sint32 src1, src2;
     1.8 +            Sint64 src1, src2;
     1.9              Sint64 dst_sample;
    1.10              const Sint64 max_audioval = ((((Sint64) 1) << (32 - 1)) - 1);
    1.11              const Sint64 min_audioval = -(((Sint64) 1) << (32 - 1));
    1.12  
    1.13              len /= 4;
    1.14              while (len--) {
    1.15 -                src1 = (Sint32) SDL_SwapLE32(*src32);
    1.16 +                src1 = (Sint64) ((Sint32) SDL_SwapLE32(*src32));
    1.17                  src32++;
    1.18                  ADJUST_VOLUME(src1, volume);
    1.19 -                src2 = (Sint32) SDL_SwapLE32(*dst32);
    1.20 +                src2 = (Sint64) ((Sint32) SDL_SwapLE32(*dst32));
    1.21                  dst_sample = src1 + src2;
    1.22                  if (dst_sample > max_audioval) {
    1.23                      dst_sample = max_audioval;
    1.24 @@ -287,17 +287,17 @@
    1.25          {
    1.26              const Uint32 *src32 = (Uint32 *) src;
    1.27              Uint32 *dst32 = (Uint32 *) dst;
    1.28 -            Sint32 src1, src2;
    1.29 +            Sint64 src1, src2;
    1.30              Sint64 dst_sample;
    1.31              const Sint64 max_audioval = ((((Sint64) 1) << (32 - 1)) - 1);
    1.32              const Sint64 min_audioval = -(((Sint64) 1) << (32 - 1));
    1.33  
    1.34              len /= 4;
    1.35              while (len--) {
    1.36 -                src1 = (Sint32) SDL_SwapBE32(*src32);
    1.37 +                src1 = (Sint64) ((Sint32) SDL_SwapBE32(*src32));
    1.38                  src32++;
    1.39                  ADJUST_VOLUME(src1, volume);
    1.40 -                src2 = (Sint32) SDL_SwapBE32(*dst32);
    1.41 +                src2 = (Sint64) ((Sint32) SDL_SwapBE32(*dst32));
    1.42                  dst_sample = src1 + src2;
    1.43                  if (dst_sample > max_audioval) {
    1.44                      dst_sample = max_audioval;