{
struct buf_info *buf;
int avail;
- bool have_data = false;
int i;
for (i = 0; i < 2; i++) {
}
if (avail > len)
avail = len;
- have_data = true;
- SDL_MixAudio(stream, buf->data + buf->pos, avail,
- SDL_MIX_MAXVOLUME);
+ memcpy(stream, buf->data + buf->pos, avail);
+ stream += avail;
buf->pos += avail;
len -= avail;
else
break;
}
- sdl.stopping = !have_data;
+ memset(stream, 0, len);
+ sdl.stopping = !!len;
}
int sandbox_sdl_sound_init(int rate, int channels)
wanted.freq = rate;
wanted.format = AUDIO_S16;
wanted.channels = channels;
- wanted.samples = 1024; /* Good low-latency value for callback */
+ wanted.samples = 960; /* Good low-latency value for callback */
wanted.callback = sandbox_sdl_fill_audio;
wanted.userdata = NULL;