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 authored and Ryan C. Gordon committed 2022-01-28 20:40:19 -05:00
1 parent 113109f839
commit 3939ef72f8
2 files changed
+16 -23

No files matched your search

+1 -3
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