|
@@ -1413,7 +1413,14 @@ SDL_OpenAudio(SDL_AudioSpec * desired, SDL_AudioSpec * obtained)
|
|
|
id = open_audio_device(NULL, 0, desired, obtained,
|
|
|
SDL_AUDIO_ALLOW_ANY_CHANGE, 1);
|
|
|
} else {
|
|
|
- id = open_audio_device(NULL, 0, desired, NULL, 0, 1);
|
|
|
+ SDL_AudioSpec _obtained;
|
|
|
+ SDL_zero(_obtained);
|
|
|
+ id = open_audio_device(NULL, 0, desired, &_obtained, 0, 1);
|
|
|
+ /* On successful open, copy calculated values into 'desired'. */
|
|
|
+ if (id > 0) {
|
|
|
+ desired->size = _obtained.size;
|
|
|
+ desired->silence = _obtained.silence;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
SDL_assert((id == 0) || (id == 1));
|