fix prepare_audiospec() possibly missing a bad SDL_AUDIO_CHANNELS env.

This commit is contained in:
Ozkan Sezer 2021-03-03 20:33:20 +03:00
parent 6158621610
commit ac8a3fda8f

View file

@ -116,7 +116,6 @@ static const AudioBootStrap *const bootstrap[] = {
#if SDL_AUDIO_DRIVER_DUMMY
&DUMMYAUDIO_bootstrap,
#endif
NULL
};
@ -1185,9 +1184,9 @@ prepare_audiospec(const SDL_AudioSpec * orig, SDL_AudioSpec * prepared)
const char *env = SDL_getenv("SDL_AUDIO_CHANNELS");
if ((!env) || ((prepared->channels = (Uint8) SDL_atoi(env)) == 0)) {
prepared->channels = 2; /* a reasonable default */
}
break;
}
}
case 1: /* Mono */
case 2: /* Stereo */
case 4: /* Quadrophonic */