SDL: Set higher number of audio samples if the obtained audio spec is more samples than requested

This commit is contained in:
Jeffrey Pfau 2014-11-09 16:07:35 -08:00
parent e10d28918d
commit 7c8401e7f8
2 changed files with 4 additions and 0 deletions

View File

@ -93,6 +93,9 @@ int main(int argc, char** argv) {
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);

View File

@ -26,6 +26,7 @@ bool GBASDLInitAudio(struct GBASDLAudio* context) {
GBALog(0, GBA_LOG_ERROR, "Could not open SDL sound system");
return false;
}
context->samples = context->obtainedSpec.samples;
SDL_PauseAudio(0);
return true;
}