mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-04 13:04:41 +00:00
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:
@@ -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;
|
||||
|
||||
@@ -96,7 +96,7 @@ static SDL_bool is_lfe_channel(int channel_index, int channel_count)
|
||||
return (channel_count == 3 && channel_index == 2) || (channel_count >= 6 && channel_index == 3);
|
||||
}
|
||||
|
||||
static void SDLCALL fill_buffer(void *userdata, SDL_AudioStream *stream, int len)
|
||||
static void SDLCALL fill_buffer(void *userdata, SDL_AudioStream *stream, int len, int totallen)
|
||||
{
|
||||
const int samples = len / sizeof(Sint16);
|
||||
Sint16 *buffer = NULL;
|
||||
|
||||
Reference in New Issue
Block a user