src/audio/SDL_audiotypecvt.c
changeset 10711 838b7f845f84
parent 10708 f6cd81aab88e
child 10737 3406a0f8b041
equal deleted inserted replaced
10710:a6babd973955 10711:838b7f845f84
   281 
   281 
   282     SDL_memcpy(sample, src, cpy);
   282     SDL_memcpy(sample, src, cpy);
   283     SDL_memcpy(last_sample, src, cpy);
   283     SDL_memcpy(last_sample, src, cpy);
   284 
   284 
   285     while (dst < target) {
   285     while (dst < target) {
   286         src += 8;
   286         src += channels;
   287         eps += dstsize;
   287         eps += dstsize;
   288         if ((eps << 1) >= srcsize) {
   288         if ((eps << 1) >= srcsize) {
   289             SDL_memcpy(dst, sample, cpy);
   289             SDL_memcpy(dst, sample, cpy);
   290             dst += 8;
   290             dst += channels;
   291             for (i = 0; i < channels; i++) {
   291             for (i = 0; i < channels; i++) {
   292                 sample[i] = (float) ((((double) src[i]) + ((double) last_sample[i])) * 0.5);
   292                 sample[i] = (float) ((((double) src[i]) + ((double) last_sample[i])) * 0.5);
   293             }
   293             }
   294             SDL_memcpy(last_sample, sample, cpy);
   294             SDL_memcpy(last_sample, sample, cpy);
   295             eps -= srcsize;
   295             eps -= srcsize;