src/audio/SDL_audiocvt.c
changeset 2078 f932ac47a331
parent 2049 5f6550e5184f
child 2130 3ee59c43d784
equal deleted inserted replaced
2077:8bfba7ec379a 2078:f932ac47a331
   138             if (SDL_AUDIO_ISBIGENDIAN(format)) {
   138             if (SDL_AUDIO_ISBIGENDIAN(format)) {
   139                 for (i = cvt->len_cvt / 8; i; --i, src += 2) {
   139                 for (i = cvt->len_cvt / 8; i; --i, src += 2) {
   140                     const Sint64 added =
   140                     const Sint64 added =
   141                         (((Sint64) (Sint32) SDL_SwapBE32(src[0])) +
   141                         (((Sint64) (Sint32) SDL_SwapBE32(src[0])) +
   142                          ((Sint64) (Sint32) SDL_SwapBE32(src[1])));
   142                          ((Sint64) (Sint32) SDL_SwapBE32(src[1])));
   143                     *(dst++) = SDL_SwapBE32((Uint32) ((Sint32) (added >> 1)));
   143                     *(dst++) = SDL_SwapBE32((Uint32) ((Sint32) (added / 2)));
   144                 }
   144                 }
   145             } else {
   145             } else {
   146                 for (i = cvt->len_cvt / 8; i; --i, src += 2) {
   146                 for (i = cvt->len_cvt / 8; i; --i, src += 2) {
   147                     const Sint64 added =
   147                     const Sint64 added =
   148                         (((Sint64) (Sint32) SDL_SwapLE32(src[0])) +
   148                         (((Sint64) (Sint32) SDL_SwapLE32(src[0])) +
   149                          ((Sint64) (Sint32) SDL_SwapLE32(src[1])));
   149                          ((Sint64) (Sint32) SDL_SwapLE32(src[1])));
   150                     *(dst++) = SDL_SwapLE32((Uint32) ((Sint32) (added >> 1)));
   150                     *(dst++) = SDL_SwapLE32((Uint32) ((Sint32) (added / 2)));
   151                 }
   151                 }
   152             }
   152             }
   153         }
   153         }
   154         break;
   154         break;
   155 
   155