cleanup SDL_GetAudioDeviceSpec

- drop unnecessary hascapture check
- call SDL_InvalidParamError and return -1 in case the index is out of range
- do not zfill SDL_AudioSpec
- adjust documentation to reflect the behavior
This commit is contained in:
pionere
2022-01-19 17:23:53 +01:00
committed by Ryan C. Gordon
parent 113109f839
commit 3939ef72f8
2 changed files with 16 additions and 23 deletions

View File

@@ -500,9 +500,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
* hardware.
*
* `spec` will be filled with the sample rate, sample format, and channel
* count. All other values in the structure are filled with 0. When the
* supported struct members are 0, SDL was unable to get the property from the
* backend.
* count.
*
* \param index the index of the audio device; valid values range from 0 to
* SDL_GetNumAudioDevices() - 1