mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-21 20:28:28 +00:00
examples: Use SDL_GetAudioStreamQueued, not SDL_GetAudioStreamAvailable.
The "available" side is at the mercy of whatever format the hardware wants, but we control what we queued. Fixes #12403.
This commit is contained in:
parent
b3336c5a73
commit
f7cadcba84
3 changed files with 3 additions and 3 deletions
|
@ -104,7 +104,7 @@ SDL_AppResult SDL_AppIterate(void *appstate)
|
|||
/* If less than a full copy of the audio is queued for playback, put another copy in there.
|
||||
This is overkill, but easy when lots of RAM is cheap. One could be more careful and
|
||||
queue less at a time, as long as the stream doesn't run dry. */
|
||||
if (SDL_GetAudioStreamAvailable(sounds[i].stream) < ((int) sounds[i].wav_data_len)) {
|
||||
if (SDL_GetAudioStreamQueued(sounds[i].stream) < ((int) sounds[i].wav_data_len)) {
|
||||
SDL_PutAudioStreamData(sounds[i].stream, sounds[i].wav_data, (int) sounds[i].wav_data_len);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue