all repos — mgba @ 7c8401e7f89266f2666aa297853e563baaa7d3de

mGBA Game Boy Advance Emulator

SDL: Set higher number of audio samples if the obtained audio spec is more samples than requested
Jeffrey Pfau jeffrey@endrift.com
Sun, 09 Nov 2014 16:07:35 -0800
commit

7c8401e7f89266f2666aa297853e563baaa7d3de

parent

e10d28918d326ed0bdd4c04cb7c1a4935c89f0ea

2 files changed, 4 insertions(+), 0 deletions(-)

jump to
M src/platform/sdl/main.csrc/platform/sdl/main.c

@@ -93,6 +93,9 @@ GBAMapArgumentsToContext(&args, &context);

renderer.audio.samples = context.audioBuffers; GBASDLInitAudio(&renderer.audio); + if (renderer.audio.samples > context.audioBuffers) { + context.audioBuffers = renderer.audio.samples * 2; + } renderer.events.bindings = &inputMap; GBASDLInitindings(&inputMap);
M src/platform/sdl/sdl-audio.csrc/platform/sdl/sdl-audio.c

@@ -26,6 +26,7 @@ if (SDL_OpenAudio(&context->desiredSpec, &context->obtainedSpec) < 0) {

GBALog(0, GBA_LOG_ERROR, "Could not open SDL sound system"); return false; } + context->samples = context->obtainedSpec.samples; SDL_PauseAudio(0); return true; }