get alsa and sdl working, though sdl seems to be mono only

This commit is contained in:
Bill Currie 2010-08-15 05:15:47 +00:00 committed by Jeff Teunissen
parent bc4a3e79dc
commit 4449f10c0a
4 changed files with 7 additions and 7 deletions

View file

@ -81,8 +81,8 @@ s_xfer_paint_buffer (int endtime)
p = (float *) snd_paintbuffer;
count = (endtime - snd_paintedtime) * snd_shm->channels;
out_mask = snd_shm->frames - 1;
out_idx = snd_paintedtime * snd_shm->channels & out_mask;
out_mask = (snd_shm->frames * snd_shm->channels) - 1;
out_idx = (snd_paintedtime * snd_shm->channels) & out_mask;
step = 3 - snd_shm->channels;
snd_vol = snd_volume->value;

View file

@ -405,7 +405,7 @@ SNDDMA_Submit (void)
if (snd_blocked)
return;
nframes = count / sn.channels;
nframes = count;
qfsnd_pcm_avail_update (pcm);
qfsnd_pcm_mmap_begin (pcm, &areas, &offset, &nframes);

View file

@ -326,7 +326,7 @@ SNDDMA_GetDMAPos (void)
}
// sn.samplepos = (count.bytes / (sn.samplebits / 8)) & (sn.samples-1);
// fprintf(stderr, "%d \r", count.ptr);
sn.framepos = count.ptr / (sn.samplebits / 8) / sn.channels; //XXX???
sn.framepos = count.ptr / (sn.samplebits / 8);
return sn.framepos;

View file

@ -109,11 +109,11 @@ main (int argc, const char *argv[])
COM_InitArgv (argc, argv);
init ();
Cbuf_Execute_Stack (testsound_cbuf);
// while (1) {
while (1) {
Cbuf_Execute_Stack (testsound_cbuf);
S_Update (vec3_origin, vec3_origin, vec3_origin, vec3_origin);
sleep(100);
// }
usleep(20 * 1000);
}
Sys_Quit ();
}