Some suggest about SDL audio source code |
ancientcc
|
Recently, I am writting a game based SDL-1.3, then found it is necessary
that modify some source code of SDL library. These code exist in both SDL.dll and SDL_mixer.dll. I list here and hope to be good for SDL developer. SDL.dll, version: (SDL-1.3.0-5538) **************************************************** <src>/audio/SDL_audiotypecvt.c function: SDL_Upsample_S16LSB_2c_x2 Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2; const Sint16 *target = ((const Sint16 *) cvt->buf) - 2; ===>update to Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4; const Sint16 *target = ((const Sint16 *) cvt->buf) - 4; --------------------------------------------------------- function: SDL_Upsample_S16LSB_2c const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ===>update to const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; ----------------------------------------------------------- function: SDL_Downsample_S16LSB_2c const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); ===>update to const int dstsize = ((int) (((double)cvt->len_cvt) * cvt->rate_incr)) & ~3; ----------------------------------------------------------- **************************************************** SDL_mixer.dll, version: (SDL_mixer-1.2.11) **************************************************** <SDL_mixer-1.2.11>/load_aiff.c function: Mix_LoadAIFF_RW *audio_buf = malloc(*audio_len); ===>update to *audio_buf = SDL_malloc(*audio_len); **************************************************** **************************************************** <SDL_mixer-1.2.11>/load_ogg.c function: Mix_LoadOGG_RW *audio_buf = malloc(*audio_len); ===>update to *audio_buf = SDL_malloc(*audio_len); **************************************************** _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||
|