Fixed order and constness of parameters to SDL_ConvertAudioSamples()
This commit is contained in:
@@ -1674,8 +1674,8 @@ void SDL_CalculateAudioSpec(SDL_AudioSpec *spec)
|
||||
}
|
||||
|
||||
int SDL_ConvertAudioSamples(
|
||||
SDL_AudioFormat src_format, Uint8 src_channels, int src_rate, int src_len, Uint8 *src_data,
|
||||
SDL_AudioFormat dst_format, Uint8 dst_channels, int dst_rate, int *dst_len, Uint8 **dst_data)
|
||||
SDL_AudioFormat src_format, Uint8 src_channels, int src_rate, const Uint8 *src_data, int src_len,
|
||||
SDL_AudioFormat dst_format, Uint8 dst_channels, int dst_rate, Uint8 **dst_data, int *dst_len)
|
||||
{
|
||||
int ret = -1;
|
||||
SDL_AudioStream *stream = NULL;
|
||||
@@ -1684,21 +1684,21 @@ int SDL_ConvertAudioSamples(
|
||||
int real_dst_len;
|
||||
|
||||
|
||||
if (src_len < 0) {
|
||||
return SDL_InvalidParamError("src_len");
|
||||
}
|
||||
if (src_data == NULL) {
|
||||
return SDL_InvalidParamError("src_data");
|
||||
}
|
||||
if (dst_len == NULL) {
|
||||
return SDL_InvalidParamError("dst_len");
|
||||
if (src_len < 0) {
|
||||
return SDL_InvalidParamError("src_len");
|
||||
}
|
||||
if (dst_data == NULL) {
|
||||
return SDL_InvalidParamError("dst_data");
|
||||
}
|
||||
if (dst_len == NULL) {
|
||||
return SDL_InvalidParamError("dst_len");
|
||||
}
|
||||
|
||||
*dst_len = 0;
|
||||
*dst_data = NULL;
|
||||
*dst_len = 0;
|
||||
|
||||
stream = SDL_CreateAudioStream(src_format, src_channels, src_rate, dst_format, dst_channels, dst_rate);
|
||||
if (stream == NULL) {
|
||||
@@ -1737,8 +1737,8 @@ int SDL_ConvertAudioSamples(
|
||||
end:
|
||||
if (ret != 0) {
|
||||
SDL_free(*dst_data);
|
||||
*dst_len = 0;
|
||||
*dst_data = NULL;
|
||||
*dst_len = 0;
|
||||
}
|
||||
SDL_DestroyAudioStream(stream);
|
||||
return ret;
|
||||
|
||||
@@ -900,7 +900,7 @@ SDL_DYNAPI_PROC(int,SDL_GetRenderVSync,(SDL_Renderer *a, int *b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_PlayAudioDevice,(SDL_AudioDeviceID a),(a),return)
|
||||
SDL_DYNAPI_PROC(void*,SDL_aligned_alloc,(size_t a, size_t b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_aligned_free,(void *a),(a),)
|
||||
SDL_DYNAPI_PROC(int,SDL_ConvertAudioSamples,(SDL_AudioFormat a, Uint8 b, int c, int d, Uint8 *e, SDL_AudioFormat f, Uint8 g, int h, int *i, Uint8 **j),(a,b,c,d,e,f,g,h,i,j),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_ConvertAudioSamples,(SDL_AudioFormat a, Uint8 b, int c, const Uint8 *d, int e, SDL_AudioFormat f, Uint8 g, int h, Uint8 **i, int *j),(a,b,c,d,e,f,g,h,i,j),return)
|
||||
SDL_DYNAPI_PROC(SDL_DisplayID*,SDL_GetDisplays,(int *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetPrimaryDisplay,(void),(),return)
|
||||
SDL_DYNAPI_PROC(const SDL_DisplayMode**,SDL_GetFullscreenDisplayModes,(SDL_DisplayID a, int *b),(a,b),return)
|
||||
|
||||
Reference in New Issue
Block a user