mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 09:23:37 +00:00
SDL: Fix DoubleBufferSDLMixerManager doubling audio latency
If it turns out that everything that had previously been fixed by this manager is broken by this change, everything that had been fixed probably could have been fixed by just increasing the audio buffer size in SdlMixerManager. :\
This commit is contained in:
parent
4a75fbab1b
commit
fa52df018e
@ -62,6 +62,13 @@ void DoubleBufferSDLMixerManager::startAudio() {
|
||||
SdlMixerManager::startAudio();
|
||||
}
|
||||
|
||||
SDL_AudioSpec DoubleBufferSDLMixerManager::getAudioSpec(uint32 rate) {
|
||||
SDL_AudioSpec desired = SdlMixerManager::getAudioSpec(rate);
|
||||
// Don't double audio latency when double buffering
|
||||
desired.samples /= 2;
|
||||
return desired;
|
||||
}
|
||||
|
||||
void DoubleBufferSDLMixerManager::mixerProducerThread() {
|
||||
byte nextSoundBuffer;
|
||||
|
||||
|
@ -44,6 +44,8 @@ protected:
|
||||
uint _soundBufSize;
|
||||
byte *_soundBuffers[2];
|
||||
|
||||
virtual SDL_AudioSpec getAudioSpec(uint32 rate) override;
|
||||
|
||||
/**
|
||||
* Handles and swap the sound buffers
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user