Fixed bug 3662 - Error message when using the audio conversion setup without an initialized audio subsystem is a bit vague
Simon Hug This issue actually raises the question if this API change (requirement of initialized audio subsystem) is breaking backwards compatibility. I don't see the documentation saying it is needed in 2.0.5.
parent
b128e8802d
commit
d619d88560
|
@ -874,8 +874,6 @@ SDL_GetAudioDriver(int index)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void SDL_ChooseAudioConverters(void);
|
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_AudioInit(const char *driver_name)
|
SDL_AudioInit(const char *driver_name)
|
||||||
{
|
{
|
||||||
|
@ -890,8 +888,6 @@ SDL_AudioInit(const char *driver_name)
|
||||||
SDL_zero(current_audio);
|
SDL_zero(current_audio);
|
||||||
SDL_zero(open_devices);
|
SDL_zero(open_devices);
|
||||||
|
|
||||||
SDL_ChooseAudioConverters();
|
|
||||||
|
|
||||||
/* Select the proper audio driver */
|
/* Select the proper audio driver */
|
||||||
if (driver_name == NULL) {
|
if (driver_name == NULL) {
|
||||||
driver_name = SDL_getenv("SDL_AUDIODRIVER");
|
driver_name = SDL_getenv("SDL_AUDIODRIVER");
|
||||||
|
|
|
@ -54,7 +54,10 @@ extern SDL_AudioFormat SDL_NextAudioFormat(void);
|
||||||
/* Function to calculate the size and silence for a SDL_AudioSpec */
|
/* Function to calculate the size and silence for a SDL_AudioSpec */
|
||||||
extern void SDL_CalculateAudioSpec(SDL_AudioSpec * spec);
|
extern void SDL_CalculateAudioSpec(SDL_AudioSpec * spec);
|
||||||
|
|
||||||
/* These pointers get set during init to various SIMD implementations. */
|
/* Choose the audio filter functions below */
|
||||||
|
extern void SDL_ChooseAudioConverters(void);
|
||||||
|
|
||||||
|
/* These pointers get set during SDL_ChooseAudioConverters() to various SIMD implementations. */
|
||||||
extern SDL_AudioFilter SDL_Convert_S8_to_F32;
|
extern SDL_AudioFilter SDL_Convert_S8_to_F32;
|
||||||
extern SDL_AudioFilter SDL_Convert_U8_to_F32;
|
extern SDL_AudioFilter SDL_Convert_U8_to_F32;
|
||||||
extern SDL_AudioFilter SDL_Convert_S16_to_F32;
|
extern SDL_AudioFilter SDL_Convert_S16_to_F32;
|
||||||
|
|
|
@ -895,11 +895,6 @@ SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
|
||||||
return SDL_InvalidParamError("cvt");
|
return SDL_InvalidParamError("cvt");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Conversions from and to float require the audio subsystem to be initialized */
|
|
||||||
if (!SDL_WasInit(SDL_INIT_AUDIO)) {
|
|
||||||
return SDL_SetError("Audio subsystem has not been initialized");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Make sure we zero out the audio conversion before error checking */
|
/* Make sure we zero out the audio conversion before error checking */
|
||||||
SDL_zerop(cvt);
|
SDL_zerop(cvt);
|
||||||
|
|
||||||
|
@ -932,6 +927,9 @@ SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
|
||||||
cvt->len_ratio = 1.0;
|
cvt->len_ratio = 1.0;
|
||||||
cvt->rate_incr = ((double) dst_rate) / ((double) src_rate);
|
cvt->rate_incr = ((double) dst_rate) / ((double) src_rate);
|
||||||
|
|
||||||
|
/* Make sure we've chosen audio conversion functions (MMX, scalar, etc.) */
|
||||||
|
SDL_ChooseAudioConverters();
|
||||||
|
|
||||||
/* SDL now favors float32 as its preferred internal format, and considers
|
/* SDL now favors float32 as its preferred internal format, and considers
|
||||||
everything else to be a degenerate case that we might have to make
|
everything else to be a degenerate case that we might have to make
|
||||||
multiple passes over the data to convert to and from float32 as
|
multiple passes over the data to convert to and from float32 as
|
||||||
|
|
Loading…
Reference in New Issue