mirror of https://github.com/mgba-emu/mgba.git
SDL: Set higher number of audio samples if the obtained audio spec is more samples than requested
This commit is contained in:
parent
e10d28918d
commit
7c8401e7f8
|
@ -93,6 +93,9 @@ int main(int argc, char** argv) {
|
||||||
|
|
||||||
renderer.audio.samples = context.audioBuffers;
|
renderer.audio.samples = context.audioBuffers;
|
||||||
GBASDLInitAudio(&renderer.audio);
|
GBASDLInitAudio(&renderer.audio);
|
||||||
|
if (renderer.audio.samples > context.audioBuffers) {
|
||||||
|
context.audioBuffers = renderer.audio.samples * 2;
|
||||||
|
}
|
||||||
|
|
||||||
renderer.events.bindings = &inputMap;
|
renderer.events.bindings = &inputMap;
|
||||||
GBASDLInitindings(&inputMap);
|
GBASDLInitindings(&inputMap);
|
||||||
|
|
|
@ -26,6 +26,7 @@ bool GBASDLInitAudio(struct GBASDLAudio* context) {
|
||||||
GBALog(0, GBA_LOG_ERROR, "Could not open SDL sound system");
|
GBALog(0, GBA_LOG_ERROR, "Could not open SDL sound system");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
context->samples = context->obtainedSpec.samples;
|
||||||
SDL_PauseAudio(0);
|
SDL_PauseAudio(0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue