X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=sndout_sdl.c;h=c0c57ab6745de82cdfd246df9885194c92df37ab;hb=4e0bc7940586d785cd2986431b43658fa5969769;hp=83b3ea2e3a7c195d4f32b2364489a3e5bcc03d17;hpb=26d3ca0d29e87a14943d29fcafc93da753df60cd;p=libpicofe.git diff --git a/sndout_sdl.c b/sndout_sdl.c index 83b3ea2..c0c57ab 100644 --- a/sndout_sdl.c +++ b/sndout_sdl.c @@ -62,7 +62,7 @@ int sndout_sdl_init(void) int sndout_sdl_start(int rate, int stereo) { - SDL_AudioSpec desired; + SDL_AudioSpec desired = { 0 }; int samples, shift; int ret; @@ -70,12 +70,12 @@ int sndout_sdl_start(int rate, int stereo) sndout_sdl_stop(); desired.freq = rate; - desired.format = AUDIO_S16LSB; + desired.format = AUDIO_S16SYS; desired.channels = stereo ? 2 : 1; desired.callback = callback; desired.userdata = NULL; - samples = rate * 4 * 16 / 1000; + samples = rate >> 6; for (shift = 8; (1 << shift) < samples; shift++) ; desired.samples = 1 << shift;