src/audio/SDL_audiotypecvt.c
changeset 10608 8661c956c368
parent 10575 bb99dede0675
child 10708 f6cd81aab88e
equal deleted inserted replaced
10607:264f6495d712 10608:8661c956c368
   237     SDL_assert(channels <= 8);
   237     SDL_assert(channels <= 8);
   238 
   238 
   239     SDL_memcpy(sample, src, cpy);
   239     SDL_memcpy(sample, src, cpy);
   240     SDL_memcpy(last_sample, src, cpy);
   240     SDL_memcpy(last_sample, src, cpy);
   241 
   241 
   242     while (dst >= target) {
   242     while (dst > target) {
   243         SDL_memcpy(dst, sample, cpy);
   243         SDL_memcpy(dst, sample, cpy);
   244         dst -= 8;
   244         dst -= 8;
   245         eps += srcsize;
   245         eps += srcsize;
   246         if ((eps << 1) >= dstsize) {
   246         if ((eps << 1) >= dstsize) {
   247             src -= 8;
   247             src -= 8;
   318 #endif
   318 #endif
   319 
   319 
   320     SDL_assert(channels <= 8);
   320     SDL_assert(channels <= 8);
   321     SDL_memcpy(last_sample, src, cpy);
   321     SDL_memcpy(last_sample, src, cpy);
   322 
   322 
   323     while (dst >= target) {
   323     while (dst > target) {
   324         for (i = 0; i < channels; i++) {
   324         for (i = 0; i < channels; i++) {
   325             dst[i] = (float) ((((double)src[i]) + ((double)last_sample[i])) * 0.5);
   325             dst[i] = (float) ((((double)src[i]) + ((double)last_sample[i])) * 0.5);
   326         }
   326         }
   327         dst -= channels;
   327         dst -= channels;
   328         SDL_memcpy(dst, src, cpy);
   328         SDL_memcpy(dst, src, cpy);
   353 #endif
   353 #endif
   354 
   354 
   355     SDL_assert(channels <= 8);
   355     SDL_assert(channels <= 8);
   356     SDL_memcpy(last_sample, src, cpy);
   356     SDL_memcpy(last_sample, src, cpy);
   357 
   357 
   358     while (dst >= target) {
   358     while (dst > target) {
   359         for (i = 0; i < channels; i++) {
   359         for (i = 0; i < channels; i++) {
   360             dst[i] = (float) ((((double) src[i]) + (3.0 * ((double) last_sample[i]))) * 0.25);
   360             dst[i] = (float) ((((double) src[i]) + (3.0 * ((double) last_sample[i]))) * 0.25);
   361         }
   361         }
   362         dst -= channels;
   362         dst -= channels;
   363         for (i = 0; i < channels; i++) {
   363         for (i = 0; i < channels; i++) {