mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 14:20:59 +00:00
get alsa and sdl working, though sdl seems to be mono only
This commit is contained in:
parent
bc4a3e79dc
commit
4449f10c0a
4 changed files with 7 additions and 7 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 ();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue