Mercurial > SDL_sound_CoreAudio
diff SDL_sound.c @ 143:3e60862fbd76
Start of audio converter work.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Mon, 15 Oct 2001 21:21:11 +0000 |
parents | fd942c1433f8 |
children | 1df5c106504e |
line wrap: on
line diff
--- a/SDL_sound.c Mon Oct 15 21:20:54 2001 +0000 +++ b/SDL_sound.c Mon Oct 15 21:21:11 2001 +0000 @@ -381,13 +381,13 @@ memcpy(&desired, (_desired != NULL) ? _desired : &sample->actual, sizeof (Sound_AudioInfo)); - if (SDL_BuildAudioCVT(&internal->sdlcvt, - sample->actual.format, - sample->actual.channels, - (int) sample->actual.rate, /* !!! FIXME: Int? Really? */ - desired.format, - desired.channels, - (int) desired.rate) == -1) /* !!! FIXME: Int? Really? */ + if (Sound_BuildAudioCVT(&internal->sdlcvt, + sample->actual.format, + sample->actual.channels, + sample->actual.rate, + desired.format, + desired.channels, + desired.rate) == -1) { Sound_SetError(SDL_GetError()); funcs->close(sample); @@ -398,7 +398,7 @@ if (internal->sdlcvt.len_mult > 1) { void *rc = realloc(sample->buffer, - sample->buffer_size * internal->sdlcvt.len_mult); + sample->buffer_size * internal->sdlcvt.len_mult); if (rc == NULL) { funcs->close(sample); @@ -611,8 +611,8 @@ if (internal->sdlcvt.needed) { internal->sdlcvt.len = retval; - SDL_ConvertAudio(&internal->sdlcvt); - retval *= internal->sdlcvt.len_mult; + Sound_ConvertAudio(&internal->sdlcvt); + retval = internal->sdlcvt.len_cvt; } /* if */ return(retval);