mirror of https://github.com/mgba-emu/mgba.git
GB, GBA Audio: Clamp audio buffer size to 8192
This commit is contained in:
parent
03dd7d70b4
commit
85aaa6c3c5
|
@ -138,6 +138,9 @@ void GBAudioReset(struct GBAudio* audio) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GBAudioResizeBuffer(struct GBAudio* audio, size_t samples) {
|
void GBAudioResizeBuffer(struct GBAudio* audio, size_t samples) {
|
||||||
|
if (samples > BLIP_BUFFER_SIZE / 2) {
|
||||||
|
samples = BLIP_BUFFER_SIZE / 2;
|
||||||
|
}
|
||||||
mCoreSyncLockAudio(audio->p->sync);
|
mCoreSyncLockAudio(audio->p->sync);
|
||||||
audio->samples = samples;
|
audio->samples = samples;
|
||||||
blip_clear(audio->left);
|
blip_clear(audio->left);
|
||||||
|
|
|
@ -106,6 +106,9 @@ void GBAAudioDeinit(struct GBAAudio* audio) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GBAAudioResizeBuffer(struct GBAAudio* audio, size_t samples) {
|
void GBAAudioResizeBuffer(struct GBAAudio* audio, size_t samples) {
|
||||||
|
if (samples > 0x2000) {
|
||||||
|
samples = 0x2000;
|
||||||
|
}
|
||||||
mCoreSyncLockAudio(audio->p->sync);
|
mCoreSyncLockAudio(audio->p->sync);
|
||||||
audio->samples = samples;
|
audio->samples = samples;
|
||||||
blip_clear(audio->psg.left);
|
blip_clear(audio->psg.left);
|
||||||
|
|
Loading…
Reference in New Issue