mirror of
https://github.com/86Box/86Box.git
synced 2026-02-24 20:35:32 -07:00
Merge pull request #2036 from Cacodemon345/patch-39
Fix brief extreme noise on hard resets
This commit is contained in:
@@ -106,6 +106,7 @@ speaker_get_buffer(int32_t *buffer, int len, void *p)
|
||||
void
|
||||
speaker_init(void)
|
||||
{
|
||||
memset(speaker_buffer, 0, sizeof(speaker_buffer));
|
||||
sound_add_handler(speaker_get_buffer, NULL);
|
||||
speaker_mute = 0;
|
||||
}
|
||||
|
||||
@@ -344,9 +344,9 @@ sound_realloc_buffers(void)
|
||||
free(outbuffer_ex_int16);
|
||||
|
||||
if (sound_is_float)
|
||||
outbuffer_ex = malloc(SOUNDBUFLEN * 2 * sizeof(float));
|
||||
outbuffer_ex = calloc(SOUNDBUFLEN * 2, sizeof(float));
|
||||
else
|
||||
outbuffer_ex_int16 = malloc(SOUNDBUFLEN * 2 * sizeof(int16_t));
|
||||
outbuffer_ex_int16 = calloc(SOUNDBUFLEN * 2, sizeof(int16_t));
|
||||
}
|
||||
|
||||
|
||||
@@ -359,7 +359,7 @@ sound_init(void)
|
||||
outbuffer_ex = NULL;
|
||||
outbuffer_ex_int16 = NULL;
|
||||
|
||||
outbuffer = malloc(SOUNDBUFLEN * 2 * sizeof(int32_t));
|
||||
outbuffer = calloc(SOUNDBUFLEN * 2, sizeof(int32_t));
|
||||
|
||||
for (i = 0; i < CDROM_NUM; i++) {
|
||||
if (cdrom[i].bus_type != CDROM_BUS_DISABLED)
|
||||
|
||||
Reference in New Issue
Block a user