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:
Ryan C. Gordon
2025-02-27 11:44:22 -05:00
parent b3336c5a73
commit f7cadcba84
3 changed files with 3 additions and 3 deletions

View File

@@ -82,7 +82,7 @@ SDL_AppResult SDL_AppIterate(void *appstate)
We're being lazy here, but if there's less than the entire wav file left to play,
just shove a whole copy of it into the queue, so we always have _tons_ of
data queued for playback. */
if (SDL_GetAudioStreamAvailable(stream) < (int)wav_data_len) {
if (SDL_GetAudioStreamQueued(stream) < (int)wav_data_len) {
/* feed more data to the stream. It will queue at the end, and trickle out as the hardware needs more data. */
SDL_PutAudioStreamData(stream, wav_data, wav_data_len);
}