this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

#1398: fixed crash

Nesbox 9a1966a9 920b13f5

+4 -24
+4 -24
src/system/sdl/main.c
··· 166 166 { 167 167 SDL_AudioSpec spec; 168 168 SDL_AudioDeviceID device; 169 - SDL_AudioCVT cvt; 170 169 } audio; 171 170 } platform 172 171 #if defined(TOUCH_INPUT_SUPPORT) ··· 193 192 .userdata = NULL, 194 193 }; 195 194 196 - platform.audio.device = SDL_OpenAudioDevice(NULL, 0, &want, &platform.audio.spec, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE | SDL_AUDIO_ALLOW_FORMAT_CHANGE | SDL_AUDIO_ALLOW_SAMPLES_CHANGE); 197 - 198 - SDL_BuildAudioCVT(&platform.audio.cvt, want.format, want.channels, platform.audio.spec.freq, platform.audio.spec.format, platform.audio.spec.channels, platform.audio.spec.freq); 199 - 200 - if(platform.audio.cvt.needed) 201 - { 202 - platform.audio.cvt.len = platform.audio.spec.freq * platform.audio.spec.channels * sizeof(s16) / TIC80_FRAMERATE; 203 - platform.audio.cvt.buf = SDL_malloc(platform.audio.cvt.len * platform.audio.cvt.len_mult); 204 - } 195 + platform.audio.device = SDL_OpenAudioDevice(NULL, 0, &want, &platform.audio.spec, 0); 205 196 } 206 197 207 198 static const u8* getSpritePtr(const tic_tile* tiles, s32 x, s32 y) ··· 1043 1034 1044 1035 static void blitSound() 1045 1036 { 1046 - tic_mem* tic = platform.studio->tic; 1047 - 1048 - SDL_PauseAudioDevice(platform.audio.device, 0); 1049 - 1050 - if(platform.audio.cvt.needed) 1051 - { 1052 - SDL_memcpy(platform.audio.cvt.buf, tic->samples.buffer, tic->samples.size); 1053 - SDL_ConvertAudio(&platform.audio.cvt); 1054 - SDL_QueueAudio(platform.audio.device, platform.audio.cvt.buf, platform.audio.cvt.len_cvt); 1055 - } 1056 - else SDL_QueueAudio(platform.audio.device, tic->samples.buffer, tic->samples.size); 1037 + tic_mem* tic = platform.studio->tic; 1038 + SDL_QueueAudio(platform.audio.device, tic->samples.buffer, tic->samples.size); 1057 1039 } 1058 1040 1059 1041 #if defined(TOUCH_INPUT_SUPPORT) ··· 1626 1608 tic_sys_fullscreen(); 1627 1609 } 1628 1610 1611 + SDL_PauseAudioDevice(platform.audio.device, 0); 1629 1612 1630 1613 #if defined(__EMSCRIPTEN__) 1631 1614 emscripten_set_main_loop(emsGpuTick, 0, 1); ··· 1659 1642 #endif 1660 1643 1661 1644 platform.studio->close(); 1662 - 1663 - if(platform.audio.cvt.buf) 1664 - SDL_free(platform.audio.cvt.buf); 1665 1645 1666 1646 { 1667 1647 destroyGPU();