audio: Change SDL_AudioStreamCallback

Now it offers the total requested bytes in addition to the amount
immediately needed (and immediately needed might be zero if the stream
already has enough queued to satisfy the request.
This commit is contained in:
Ryan C. Gordon
2023-09-13 10:11:23 -04:00
parent 9da34e8fb5
commit 8b26e95f91
4 changed files with 21 additions and 14 deletions

View File

@@ -356,7 +356,7 @@ static void loop(void)
}
}
static void SDLCALL our_get_callback(void *userdata, SDL_AudioStream *strm, int approx_amount)
static void SDLCALL our_get_callback(void *userdata, SDL_AudioStream *strm, int approx_amount, int total_amount)
{
last_get_callback = SDL_GetTicks();
last_get_amount = approx_amount;