src/audio/SDL_audiocvt.c
changeset 7410 a9878830f05e
parent 7191 75360622e65f
child 8093 b43765095a6f
equal deleted inserted replaced
7409:8b5ae6ff6a49 7410:a9878830f05e
   291 #define dup_chans_1_to_2(type) \
   291 #define dup_chans_1_to_2(type) \
   292     { \
   292     { \
   293         const type *src = (const type *) (cvt->buf + cvt->len_cvt); \
   293         const type *src = (const type *) (cvt->buf + cvt->len_cvt); \
   294         type *dst = (type *) (cvt->buf + cvt->len_cvt * 2); \
   294         type *dst = (type *) (cvt->buf + cvt->len_cvt * 2); \
   295         for (i = cvt->len_cvt / sizeof(type); i; --i) { \
   295         for (i = cvt->len_cvt / sizeof(type); i; --i) { \
   296             const type val = *src; \
       
   297             src -= 1; \
   296             src -= 1; \
   298             dst -= 2; \
   297             dst -= 2; \
   299             dst[0] = dst[1] = val; \
   298             dst[0] = dst[1] = *src; \
   300         } \
   299         } \
   301     }
   300     }
   302 
   301 
   303     /* this function only cares about typesize, and data as a block of bits. */
   302     /* this function only cares about typesize, and data as a block of bits. */
   304     switch (SDL_AUDIO_BITSIZE(format)) {
   303     switch (SDL_AUDIO_BITSIZE(format)) {