Refactored audio conversion to reduce copying

More of the logic has been moved into SDL_AudioQueue,
allowing data to be converted directly from the input buffer.
This commit is contained in:
Brick
2024-04-04 19:22:29 +01:00
committed by Sam Lantinga
parent ae57b0c9d8
commit edaab8ad9f
7 changed files with 478 additions and 409 deletions

View File

@@ -789,13 +789,13 @@ extern DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStream *
extern DECLSPEC int SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float ratio);
/**
* Add data to be converted/resampled to the stream.
* Add data to the stream.
*
* This data must match the format/channels/samplerate specified in the latest
* call to SDL_SetAudioStreamFormat, or the format specified when creating the
* stream if it hasn't been changed.
*
* Note that this call simply queues unconverted data for later. This is
* Note that this call simply copies the unconverted data for later. This is
* different than SDL2, where data was converted during the Put call and the
* Get call would just dequeue the previously-converted data.
*