mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Fixed build
This commit is contained in:
parent
990e166a3b
commit
a21b5b3018
@ -722,7 +722,7 @@ SDL_ResampleCVT(SDL_AudioCVT *cvt, const int chans, const SDL_AudioFormat format
|
|||||||
int paddingsamples;
|
int paddingsamples;
|
||||||
float *padding;
|
float *padding;
|
||||||
|
|
||||||
if (requestedpadding < INT32_MAX / chans) {
|
if (requestedpadding < SDL_MAX_SINT32 / chans) {
|
||||||
paddingsamples = requestedpadding * chans;
|
paddingsamples = requestedpadding * chans;
|
||||||
} else {
|
} else {
|
||||||
paddingsamples = 0;
|
paddingsamples = 0;
|
||||||
@ -899,9 +899,9 @@ SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
|
|||||||
return SDL_SetError("Source rate is equal to or less than zero");
|
return SDL_SetError("Source rate is equal to or less than zero");
|
||||||
} else if (dst_rate <= 0) {
|
} else if (dst_rate <= 0) {
|
||||||
return SDL_SetError("Destination rate is equal to or less than zero");
|
return SDL_SetError("Destination rate is equal to or less than zero");
|
||||||
} else if (src_rate >= INT32_MAX / RESAMPLER_SAMPLES_PER_ZERO_CROSSING) {
|
} else if (src_rate >= SDL_MAX_SINT32 / RESAMPLER_SAMPLES_PER_ZERO_CROSSING) {
|
||||||
return SDL_SetError("Source rate is too high");
|
return SDL_SetError("Source rate is too high");
|
||||||
} else if (dst_rate >= INT32_MAX / RESAMPLER_SAMPLES_PER_ZERO_CROSSING) {
|
} else if (dst_rate >= SDL_MAX_SINT32 / RESAMPLER_SAMPLES_PER_ZERO_CROSSING) {
|
||||||
return SDL_SetError("Destination rate is too high");
|
return SDL_SetError("Destination rate is too high");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -641,7 +641,9 @@ MS_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len)
|
|||||||
size_t bytesleft, outputsize;
|
size_t bytesleft, outputsize;
|
||||||
WaveChunk *chunk = &file->chunk;
|
WaveChunk *chunk = &file->chunk;
|
||||||
ADPCM_DecoderState state = {0};
|
ADPCM_DecoderState state = {0};
|
||||||
MS_ADPCM_ChannelState cstate[2] = {0};
|
MS_ADPCM_ChannelState cstate[2];
|
||||||
|
|
||||||
|
SDL_memset(cstate, 0, sizeof(cstate));
|
||||||
|
|
||||||
if (chunk->size != chunk->length) {
|
if (chunk->size != chunk->length) {
|
||||||
/* Could not read everything. Recalculate number of sample frames. */
|
/* Could not read everything. Recalculate number of sample frames. */
|
||||||
@ -2075,7 +2077,9 @@ SDL_AudioSpec *
|
|||||||
SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
|
SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
WaveFile file = {0};
|
WaveFile file;
|
||||||
|
|
||||||
|
SDL_zero(file);
|
||||||
|
|
||||||
/* Make sure we are passed a valid data source */
|
/* Make sure we are passed a valid data source */
|
||||||
if (src == NULL) {
|
if (src == NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user