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
2 files changed,
4 insertions(+),
0 deletions(-)
M
src/platform/sdl/main.c
→
src/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.c
→
src/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; }