src/audio/SDL_audiotypecvt.c
changeset 11993 fdf104726ced
parent 11992 08c415f14810
child 11995 b34d86386ee1
equal deleted inserted replaced
11992:08c415f14810 11993:fdf104726ced
   277     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
   277     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
   278         const float sample = *src;
   278         const float sample = *src;
   279         if (sample >= 1.0f) {
   279         if (sample >= 1.0f) {
   280             *dst = 2147483647;
   280             *dst = 2147483647;
   281         } else if (sample <= -1.0f) {
   281         } else if (sample <= -1.0f) {
   282             *dst = -2147483648;
   282             *dst = (Sint32) -2147483648LL;
   283         } else {
   283         } else {
   284             *dst = ((Sint32)(sample * 8388607.0f)) << 8;
   284             *dst = ((Sint32)(sample * 8388607.0f)) << 8;
   285         }
   285         }
   286     }
   286     }
   287 
   287