Mercurial > sdl-ios-xcode
comparison src/audio/SDL_audiocvt.c @ 2883:11626a53e7bc
indent
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 20 Dec 2008 08:41:05 +0000 |
parents | c8d203ef4335 |
children | 7e30c2dc7783 |
comparison
equal
deleted
inserted
replaced
2882:04e89201f6ed | 2883:11626a53e7bc |
---|---|
1677 dst[i] = fix(fSinc[i] * norm_fact); \ | 1677 dst[i] = fix(fSinc[i] * norm_fact); \ |
1678 } \ | 1678 } \ |
1679 } | 1679 } |
1680 | 1680 |
1681 /* !!! FIXME: this memory leaks. */ | 1681 /* !!! FIXME: this memory leaks. */ |
1682 cvt->coeff = (Uint8 *) SDL_malloc((SDL_AUDIO_BITSIZE(format) / 8) * (m+1)); | 1682 cvt->coeff = |
1683 (Uint8 *) SDL_malloc((SDL_AUDIO_BITSIZE(format) / 8) * (m + 1)); | |
1683 if (cvt->coeff == NULL) { | 1684 if (cvt->coeff == NULL) { |
1684 return -1; | 1685 return -1; |
1685 } | 1686 } |
1686 | 1687 |
1687 /* If we're using floating point, we only need to normalize */ | 1688 /* If we're using floating point, we only need to normalize */ |
1704 } | 1705 } |
1705 } | 1706 } |
1706 | 1707 |
1707 /* Initialize the state buffer to all zeroes, and set initial position */ | 1708 /* Initialize the state buffer to all zeroes, and set initial position */ |
1708 /* !!! FIXME: this memory leaks. */ | 1709 /* !!! FIXME: this memory leaks. */ |
1709 cvt->state_buf = (Uint8 *) SDL_malloc(cvt->len_sinc * SDL_AUDIO_BITSIZE(format) / 4); | 1710 cvt->state_buf = |
1711 (Uint8 *) SDL_malloc(cvt->len_sinc * SDL_AUDIO_BITSIZE(format) / 4); | |
1710 if (cvt->state_buf == NULL) { | 1712 if (cvt->state_buf == NULL) { |
1711 return -1; | 1713 return -1; |
1712 } | 1714 } |
1713 SDL_memset(cvt->state_buf, 0, | 1715 SDL_memset(cvt->state_buf, 0, |
1714 cvt->len_sinc * SDL_AUDIO_BITSIZE(format) / 4); | 1716 cvt->len_sinc * SDL_AUDIO_BITSIZE(format) / 4); |