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 authored and Sam Lantinga committed 2024-04-15 11:47:18 -10:00
1 parent ae57b0c9d8
commit edaab8ad9f
7 files changed
+478 -409

No files matched your search

+2 -2
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.
*